QuantizedLinear¶
- class aimet_torch.nn.QuantizedLinear(*args, **kwargs)[source]¶
Quantized subclass of torch.nn.Linear
- forward(self, input: torch.Tensor) torch.Tensor [source]
Quantized forward of torch.nn.Linear.
The input(s), parameter(s) (if any), and output(s) will be quantized with
self.input_quantizers
,self.param_quantizers
, andself.output_quantizers
respectively.For more information, see
QuantizationMixin
.
- forward(*args, **kwargs)[source]¶
Computes a quantized version of the parent module’s forward method.
The
forward()
method should perform the following logic in order:Apply existing input quantizers to input tensors
Apply existing param quantizers to the layer’s parameters
Call the inherited
torch.nn.Module
forward method with quantized inputs and parametersApply existing output quantizers to the outputs of the forward method
If all input, output, and parameter quantizers are
None
, this method will behave exactly the same as its parent module’s forward pass.