/usr/local/lib64/python3.6/site-packages/torch/quantization/fx
NameSizeModeActions
backend_config_dict/-0755rm
__pycache__/-0755rm
convert.py244810644editdlrm
fuse.py29980644editdlrm
fusion_patterns.py68620644editdlrm
graph_module.py51170644editdlrm
lower_to_fbgemm.py3370644editdlrm
lower_to_qnnpack.py3390644editdlrm
match_utils.py62780644editdlrm
pattern_utils.py21710644editdlrm
prepare.py489700644editdlrm
qconfig_utils.py118180644editdlrm
quantization_patterns.py978070644editdlrm
quantization_types.py3190644editdlrm
quantized_fusion_patterns_and_replacements.py8760644editdlrm
utils.py206980644editdlrm
_equalize.py362400644editdlrm
_lower_to_native_backend.py7410644editdlrm
__init__.py2120644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/quantization/fx/_lower_to_native_backend.py (741B)
from torch.fx import subgraph_rewriter from .graph_module import QuantizedGraphModule from .quantized_fusion_patterns_and_replacements import get_fbgemm_patterns_and_replacements def _lower_to_native_backend(model: QuantizedGraphModule) -> QuantizedGraphModule: """ Lower a quantized reference model (with reference quantized operator patterns) to the native backend in PyTorch (fbgemm/qnnpack), both backends shares the same operator signature so they can be lowered with the same function """ module_dict = dict(model.named_modules()) for pattern, replacement in get_fbgemm_patterns_and_replacements(): subgraph_rewriter.replace_pattern(model, pattern, replacement) model.graph.lint() return model