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

本站现有博文332篇,共被浏览895469

本站已经建立2597天!

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