IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

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.