Files
pytorch/torch/quantization/fx/_equalize.py
Hao Li aa40503954 Add Custom Module Support List (#82606)
Summary:
Add a global custon module support list  for the users to specify the modules they want the equalization process support.

To use this list, import it from the _equalize.py file and append module in it.

Unittest passed to check global support list:

https://pxl.cl/28RKG

Test Plan: buck1 test mode/dev //on_device_ai/odai/tests/transforms:test_transforms -- --exact 'on_device_ai/odai/tests/transforms:test_transforms - test_custom_support_list (on_device_ai.odai.tests.transforms.test_input_weight_for_turing.TestInputWeight)'

Reviewed By: jerryzh168

Differential Revision: D38264244

Pull Request resolved: https://github.com/pytorch/pytorch/pull/82606
Approved by: https://github.com/HDCharles
2022-08-03 17:48:51 +00:00

39 lines
1.2 KiB
Python

# flake8: noqa: F401
r"""
This file is in the process of migration to `torch/ao/quantization`, and
is kept here for compatibility while the migration process is ongoing.
If you are adding a new entry/functionality, please, add it to the
appropriate files under `torch/ao/quantization/fx/`, while adding an import statement
here.
"""
from torch.ao.quantization.fx._equalize import (
reshape_scale,
_InputEqualizationObserver,
_WeightEqualizationObserver,
calculate_equalization_scale,
EqualizationQConfig,
input_equalization_observer,
weight_equalization_observer,
default_equalization_qconfig,
fused_module_supports_equalization,
nn_module_supports_equalization,
custom_module_supports_equalization,
node_supports_equalization,
is_equalization_observer,
get_op_node_and_weight_eq_obs,
maybe_get_weight_eq_obs_node,
maybe_get_next_input_eq_obs,
maybe_get_next_equalization_scale,
scale_input_observer,
scale_weight_node,
scale_weight_functional,
clear_weight_quant_obs_node,
remove_node,
update_obs_for_equalization,
convert_eq_obs,
_convert_equalization_ref,
get_layer_sqnr_dict,
get_equalization_qconfig_dict,
CUSTOM_MODULE_SUPP_LIST,
)