megengine.quantization.quantize

quantize(module, inplace=True, mapping=None)[source]

Recursively convert QATModule to QuantizedModule through apply.

Parameters
  • module (Module) – root module to do convert recursively.

  • inplace (bool) – whether to convert submodules in-place.

  • mapping (Optional[dict]) – a dict indicating how to convert custom modules from QATModule to QuantizedModule. Will be combined with internal default convert mapping dict.