Python class
WeightScaleSpec
WeightScaleSpec
class max.nn.WeightScaleSpec(granularity, dtype, block_size=None)
Bases: object
Specifies how weights are scaled for scaled quantization.
-
Parameters:
-
- granularity (ScaleGranularity)
- dtype (DType)
- block_size (tuple[int, int] | None)
block_size
The tuple[int, int] of the block size for block-wise scaling.
dtype
dtype: DType
The DType of the weight scale factor(s).
granularity
granularity: ScaleGranularity
The ScaleGranularity of the weight scale factor application.
is_block
property is_block: bool
Whether the weight scale granularity is block-wise.
is_colwise
property is_colwise: bool
Whether the weight scale granularity is column-wise.
is_rowwise
property is_rowwise: bool
Whether the weight scale granularity is row-wise.
is_tensor
property is_tensor: bool
Whether the weight scale granularity is per-tensor.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!