Burn Pack
The burnpack binary serialization format for the Burn deep learning framework
burn-pack reads and writes the burnpack container format. It is tensor-library-agnostic and
dependency-light: it depends only on burn-std (for DType
/ Bytes), serde, and a CBOR codec — it knows the on-disk format but has no notion of Burn
modules. Tensor data is Bytes-native and read lazily from files (256-byte aligned for
zero-copy mmap and efficient GPU transfers), and the reader is hardened against malformed input.
If you just want to save and load Burn models, use the higher-level
burn-core record API or
burn-store (which adds PyTorch/SafeTensors interop).
Reach for burn-pack directly only to produce or consume the raw format.
Usage
use ;
let raw: = .iter.flat_map.collect;
let tensor = new;
let packed = new.into_bytes.unwrap;
let reader = from_bytes.unwrap;
assert_eq!;
Use Writer::write_to_file / Reader::from_file for disk I/O (the default std feature; disable
it for no-std targets). See the docs for the format layout and the
full API.
License
This project is dual-licensed under MIT and Apache-2.0.