megengine.quantization.fake_quant_bias#

fake_quant_bias(bias, inp, w_qat)[source]#

Apply fake quantization to bias, with the special scale from input tensor and weight tensor, the quantized type set to qint32 also.

Parameters:
  • bias (Tensor) – the bias tensor which need to be faked.

  • inp (Tensor) – the input tensor which contain the quantization parameters.

  • w_qat (Tensor) – the weight tensor which contain the quantization parameters.

Warning

Only work for symmetric quantization method now.

Return type:

Tensor