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

本站现有博文339篇,共被浏览995973次

本站已经建立2706天!

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