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

本站现有博文334篇,共被浏览930745

本站已经建立2639天!

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