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

本站现有博文323篇,共被浏览795914

本站已经建立2493天!

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