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

本站现有博文338篇,共被浏览972391次

本站已经建立2685天!

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