Artifact weights

class torch_lattice.artifact.weights.PackedWeight(weight, scales, biases)[source]

Bases: object

Affine group-quantized artifact storage tensors.

Parameters:
weight: Tensor
scales: Tensor
biases: Tensor
torch_lattice.artifact.weights.dequantize_artifact_weight(tensor, *, bits, group_size, scale_dtype='f16')[source]

Round-trip a logical weight through artifact quantization.

Return type:

Tensor

Parameters:
torch_lattice.artifact.weights.pack_quantized_weight(tensor, *, bits, group_size, scale_dtype)[source]

Pack a logical artifact weight using affine group quantization.

Return type:

PackedWeight

Parameters: