Skip to main content

Python class

ScaleGranularity

ScaleGranularity

class max.nn.ScaleGranularity(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

source

Bases: Enum

Specifies the granularity of the quantization scale factor.

Determines whether a scale factor applies per-tensor, per-row (often for weights), per-column, or per-block within a tensor.

BLOCK

BLOCK = 'block'

source

Per-block scaling.

COLWISE

COLWISE = 'colwise'

source

Per-column scaling.

ROWWISE

ROWWISE = 'rowwise'

source

Per-row scaling.

TENSOR

TENSOR = 'tensor'

source

Per-tensor scaling.