Rate this Page

swap_module#

classtorch.ao.quantization.swap_module(mod,mapping,custom_module_class_mapping,use_precomputed_fake_quant=False)[source]#

Swaps the module if it has a quantized counterpart and it has anobserver attached.

Parameters
  • mod – input module

  • mapping – a dictionary that maps from nn module to nnq module

Returns

The corresponding quantized module ofmod