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

本站现有博文321篇,共被浏览768971

本站已经建立2454天!

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