Skip to main content

Python module

max.graph.weights

Weight containers​

WeightDataContainer for weight tensor data with metadata.
WeightsProtocol for managing and accessing model weights hierarchically.
WeightsAdapteralias of Callable[[...], dict[str, WeightData]]

Format-specific loaders​

GGUFWeightsImplementation for loading weights from GGUF (GPT-Generated Unified Format) files.
SafetensorWeightsImplementation for loading weights from safetensors files.

Loading functions​

load_weightsLoads neural network weights from checkpoint files.
weights_formatDetect the format of weight files based on their extensions.

Enums​

WeightsFormatEnumeration of supported weight file formats.