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

本站现有博文341篇,共被浏览1047881次

本站已经建立2729天!

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