Table of Contents
Shortcuts

# swap_module

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

  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

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.