FakeQuantize

class FakeQuantize(dtype, enable=True, **kwargs)[源代码]

可根据observer的scale和zero_point参数来进行量化(Quantization)和反量化(Dequantization)的模块。

参数
  • dtype (Union[str, QuantDtypeMeta]) – a string or QuantDtypeMeta indicating the target quantization dtype of input.

  • enable (bool) – whether do normal_forward or fake_quant_forward.