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

本站现有博文330篇,共被浏览861400

本站已经建立2570天!

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