|
pulsatrix
|
Native safetensors reader and writer (roadmap IO-1): the one file format pulsatrix reads and writes for weights. More...
#include <cstddef>#include <cstdint>#include <map>#include <string>#include <utility>#include <vector>#include "pulsatrix/tensor.hpp"
Go to the source code of this file.
Classes | |
| struct | pulsatrix::SafetensorsTensorInfo |
| One tensor's header entry. Offsets are relative to the start of the data section. More... | |
| class | pulsatrix::SafetensorsFile |
| A parsed, fully validated safetensors file held in memory. More... | |
Namespaces | |
| namespace | pulsatrix |
Enumerations | |
| enum class | pulsatrix::SafetensorsDtype { pulsatrix::Bool , pulsatrix::U8 , pulsatrix::I8 , pulsatrix::I16 , pulsatrix::U16 , pulsatrix::I32 , pulsatrix::U32 , pulsatrix::I64 , pulsatrix::U64 , pulsatrix::F8_E4M3 , pulsatrix::F8_E5M2 , pulsatrix::F16 , pulsatrix::BF16 , pulsatrix::F32 , pulsatrix::F64 } |
| Element types a safetensors file can declare. Only F32 converts to a Tensor so far. More... | |
Functions | |
| std::vector< uint8_t > | pulsatrix::SerializeSafetensors (const std::vector< std::pair< std::string, const Tensor * > > &tensors, const std::map< std::string, std::string > &metadata={}) |
| Serializes tensors (as F32) and string metadata into safetensors bytes. | |
| void | pulsatrix::WriteSafetensors (const std::string &path, const std::vector< std::pair< std::string, const Tensor * > > &tensors, const std::map< std::string, std::string > &metadata={}) |
SerializeSafetensors() written to path. | |
Native safetensors reader and writer (roadmap IO-1): the one file format pulsatrix reads and writes for weights.
.pt, .pth, .pkl).