megengine.quantization.quantize_qat#

quantize_qat(module, inplace=True, qconfig=ema_fakequant_qconfig, mapping=None)[源代码]#

通过使用 apply 并设置相应的 qconfig, 递归地将 float Module 转换为 QATModule.

参数:
  • module (Module) – 根模块,以此开始递归地进行转换。

  • inplace (bool) – 是否对子模块进行原地转换。

  • qconfig (QConfig) – an instance of QConfig to be set as submodules’ qconfig. default is ema_fakequant_qconfig.

  • mapping (Optional[dict]) – 一个用来指示如何把 Module 转换为 QATModule 的字典。将会和内部的默认的转换映射字典合并。