EADST

C++: Load Raw Data and Convert to Float Pointer

C++: Load Raw Data and Convert to Float Pointer

 #include  < fstream>
#include  < iostream>

using namespace std;


int main() {
    string file_path = "./test.raw";
    ifstream fin;
    fin.open(file_path,  std::ios::binary);
    if (!fin) {
        cerr << "open failed: " << file_path << endl;
        return -1;
    }
    fin.seekg(0, fin.end);
    int length = fin.tellg();
    fin.seekg(0, fin.beg);
    char* buffer = new char[length];
    fin.read(buffer, length);
    // convert to float pointer
    float *tmp = (float *)buffer;
    for(int idx = 0;idx < 100;idx++)
    {   
        cout << tmp[idx] << endl;
    }
    return 0;
}
相关标签
C++
About Me
XD
Goals determine what you are going to be.
Category
标签云
API Random Bipartite COCO Plate scipy Ubuntu Template Paddle Hungarian Jetson LaTeX Base64 Crawler LLM Nginx Anaconda C++ uWSGI XML CC mmap Password Image2Text 搞笑 SAM Magnet ChatGPT 图标 多线程 Python FP8 版权 EXCEL Qwen2 Google printf Tensor logger Distillation ResNet-50 icon Tiktoken git 图形思考法 hf BF16 Animate Quantization WAN Cloudreve DeepStream Pytorch Ptyhon SQLite LLAMA MD5 Bitcoin Firewall v0.dev Bin Rebuttal Github Algorithm Qwen CEIR Pickle PDF FastAPI Vim InvalidArgumentError Tracking Baidu Datetime 阿里云 IndexTTS2 NLP TSV Translation Quantize BeautifulSoup OpenAI Streamlit Domain News CSV CUDA NLTK XGBoost Land Shortcut 域名 第一性原理 Card Heatmap Bert Proxy SQL Linux Vmess Paper GGML BTC uwsgi 关于博主 LeetCode Excel TTS Numpy HuggingFace 递归学习法 GPT4 Claude tqdm Knowledge Input Django FP64 算法题 Food GoogLeNet Gemma Zip torchinfo Review Attention YOLO 签证 Windows Search VGG-16 Logo 云服务器 Disk FP32 RL 腾讯云 OCR Math PyTorch SVR diffusers LoRA 净利润 公式 QWEN Docker Data 论文 财报 Interview TensorFlow llama.cpp VSCode Conda PyCharm TensorRT v2ray 强化学习 AI Pillow PIP Jupyter Clash UI CV Llama ms-swift Freesound WebCrawler Web ONNX transformers Mixtral git-lfs Qwen2.5 Pandas RGB Safetensors FlashAttention 飞书 Video Diagram 报税 JSON PDB NameSilo Breakpoint Statistics CAM Agent Git CLAP 多进程 顶会 继承 GIT Plotly VPN RAR Markdown GPTQ Website Transformers FP16 Color OpenCV Dataset Hilton Permission 音频 证件照 UNIX 论文速读 CTC Sklearn SPIE ModelScope tar DeepSeek Michelin Use Hotel HaggingFace Miniforge Augmentation
站点统计

本站现有博文332篇,共被浏览875663

本站已经建立2583天!

热门文章
文章归档
回到顶部