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

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

本站已经建立2597天!

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