Shortcuts

swap_module

class torch.ao.quantization.swap_module(mod, mapping, custom_module_class_mapping)[source]

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

Parameters
  • mod – input module

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

Returns

The corresponding quantized module of mod

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources