swap_module — PyTorch 2.7 documentation (original) (raw)
class torch.ao.quantization.swap_module(mod, mapping, custom_module_class_mapping, use_precomputed_fake_quant=False)[source][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 of mod
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.