pytorch / 1 / generated / torch.quantization.add_observer_.html

add_observer

class torch.quantization.add_observer_(module, qconfig_propagation_list=None, non_leaf_module_list=None, device=None, custom_module_class_mapping=None) [source]

Add observer for the leaf child of the module.

This function insert observer module to all leaf child module that has a valid qconfig attribute.

Parameters:
  • module – input module with qconfig attributes for all the leaf modules that we want to quantize
  • qconfig_propagation_list – a list of quantizable modules that will have observers added to them if they are leaf nodes
  • device – parent device, if any
  • non_leaf_module_list – list of non-leaf modules we want to add observer
Returns:

None, module is modified inplace with added observer modules and forward_hooks

© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/1.13/generated/torch.quantization.add_observer_.html