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