megengine.quantization.fake_quant_tensor#

fake_quant_tensor(inp, qparams)[source]#

Apply fake quantization to the inp tensor.

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

  • qparams (QParams) – to get mode, qmin, qmax, scale and zero_point from.

Return type:

Tensor