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

QTensor

QTensor​

class max.nn.common_layers.quant_tensor.QTensor

source

Bases: Module

Base class for quantized tensor wrappers.

QTensors are Module subclasses so that parameter discovery finds the inner tensors. They are data wrappers, not callable layers — pass them to a quantized kernel op (such as quant_ops.matmul).

forward()​

forward()

source

Raises, since a QTensor is a data wrapper rather than a layer.

Return type:

None

local_shards​

property local_shards: tuple[Self, ...]

source

Per-device shards of this tensor; subclasses implement it.

mesh​

property mesh: DeviceMesh

source

Device mesh the tensor is placed on; subclasses implement it.

to()​

to(target)

source

Returns a copy placed on target; subclasses implement it.

Parameters:

target (Device | DeviceMesh | DeviceMapping)

Return type:

Self