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

本站现有博文337篇,共被浏览949784

本站已经建立2661天!

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