QuantizedConv2d¶
- class aimet_torch.nn.QuantizedConv2d(*args, **kwargs)[source]¶
Quantized subclass of torch.nn.Conv2d
- forward(self, input: torch.Tensor) torch.Tensor
Quantized forward of torch.nn.Conv2d.
The input(s), parameter(s) (if any), and output(s) will be quantized with
self.input_quantizers,self.param_quantizers, andself.output_quantizersrespectively.For more information, see
QuantizationMixin.
- compute_encodings()¶
Compute encodings with additional protection against bias overflow. HTP expects bias_scale = input_scale * weight_scale, which can cause bias overflow if bias_scale is too small. If bias overflow is expected, this function increases weight_scale until |bias / (input_scale * weight_scale)| <= 2**31