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

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

本站已经建立2493天!

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