tensor/safe_tensor_loader library

Classes

SafetensorsLoader
Utility class for reading and deserializing model weights from Hugging Face Safetensors files into GPUTensor instances. Parses the 8-byte header length, extracts the JSON metadata header, slices binary tensor chunks, handles matrix transpositions between coordinate standards, and pushes data directly into VRAM.

Functions

printSafetensorsStructure(String filePath) → void
Reads a Safetensors file from filePath and logs the name, shape, and data type of every serialized tensor.