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

本站现有博文328篇,共被浏览840165

本站已经建立2545天!

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