Expand description
Writing .safetensors output. teeny-data::safetensors only supports mmap’d reading, so
this writes directly via the safetensors crate rather than extending that (leaf) crate –
see teenygrad-303.2.
Structs§
- Output
Tensor - One tensor to be written: its dtype, shape, and raw little-endian bytes (already in whatever
on-disk representation
dtypeimplies – e.g. packedU8nibbles for INT4).
Functions§
- serialize_
safetensors - Serializes
tensorsplusmetadata(embedded as the file’s string-keyed__metadata__header – e.g. thequantization_configJSON blob, seecrate::format) to an in-memory.safetensorsbyte buffer. - write_
safetensors - Serializes
tensors/metadata(seeserialize_safetensors) directly to a.safetensorsfile atpath.