BackendPatternConfig¶
- class torch.ao.quantization.backend_config.BackendPatternConfig(pattern)[source]¶
Config for ops defined in
BackendConfig
. For a detailed example usage, seeBackendConfig
.- add_dtype_config(dtype_config)[source]¶
Add a set of supported input/output activation, weight, and bias data types for this pattern.
- Return type:
- classmethod from_dict(backend_pattern_config_dict)[source]¶
Create a
BackendPatternConfig
from a dictionary with the following items:“pattern”: the pattern being configured “observation_type”: the
ObservationType
that specifies how observers should be inserted for this pattern “dtype_configs”: a list of dictionaries that representsDTypeConfig
s “root_module”: atorch.nn.Module
that represents the root for this pattern “qat_module”: atorch.nn.Module
that represents the QAT implementation for this pattern “reference_quantized_module”: atorch.nn.Module
that represents the reference quantized implementation for this pattern’s root module. “fused_module”: atorch.nn.Module
that represents the fused implementation for this pattern “fuser_method”: a function that specifies how to fuse the pattern for this pattern- Return type:
- set_dtype_configs(dtype_configs)[source]¶
Set the supported input/output activation, weight, and bias data types for this pattern, overriding all previously registered data types.
- Return type:
- set_fused_module(fused_module)[source]¶
Set the module that represents the fused implementation for this pattern.
- Return type:
- set_fuser_method(fuser_method)[source]¶
Set the function that specifies how to fuse the pattern for this pattern.
- Return type:
- set_observation_type(observation_type)[source]¶
Set how observers should be inserted for this pattern. See
ObservationType
for details- Return type:
- set_qat_module(qat_module)[source]¶
Set the module that represents the QAT implementation for this pattern.
- Return type:
- set_reference_quantized_module(reference_quantized_module)[source]¶
Set the module that represents the reference quantized implementation for this pattern’s root module.
- Return type:
- set_root_module(root_module)[source]¶
Set the module that represents the root for this pattern. For example, the root module for
torch.nn.intrinsic.LinearReLU
should betorch.nn.Linear
.- Return type: