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

本站现有博文340篇,共被浏览1019343次

本站已经建立2719天!

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