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

本站现有博文333篇,共被浏览914715

本站已经建立2618天!

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