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

本站现有博文324篇,共被浏览819960

本站已经建立2524天!

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