Skip to main content

QLinearWoQ

Weight-only-quantized linear: the weight binds as a :class:QTensor (a dense weight is refused) and compute runs at the activation dtype.

__init__

__init__(self, in_features: 'int', out_features: 'int', bias: 'bool' = False, *, activation: 'Activation | None' = None, residency: 'WeightResidency | None' = None) -> 'None'

Declare the slots (canonical logical orientation [in_features, out_features]). residency takes an nn.WeightResidency value; None keeps Packed.

extra_repr

extra_repr(self) -> 'str'

One line of per-class detail for :meth:__repr__ (a layer prints its geometry here).

forward

forward(self, x: 'Tensor') -> 'Tensor'

Subclasses define the computation here; call the module itself (m(x)), not forward directly.

from_weights

from_weightsConstruct FROM a quantized weight (e.g. ``ops.quantize``'s

Construct FROM a quantized weight (e.g. ops.quantize's QTensor): geometry, dtype, and device read off the payload.

set_weights

set_weights(self, weight: 'QTensor', bias: 'Tensor | None' = None) -> 'None'

Bind the quantized weight (and the optional float bias); a dense weight is refused.