class_docstr: Builds py:class:`QConfigMapping` from :py:class:`LinearQuantizerConfig`.
class_docstr_tok: ["Builds","py",":","class",":","`","QConfigMapping","`","from",":","py",":","class",":","`","LinearQuantizerConfig","`","."]
docstr: Returns default QconfigMapping for a given quantization scheme. If a qconfig is passed,
  it is used as the default qconfig instead.
docstr_tok: ["Returns","default","QconfigMapping","for","a","given","quantization","scheme",".","If","a","qconfig","is","passed",",","it","is","used","as","the","default","qconfig","instead","."]
code: def get_default_qconfig_mapping(
      self,
      quantization_scheme: _QuantizationScheme,
      qconfig: _Optional[_aoquant.QConfig] = None,
  ) -> _aoquant.QConfigMapping:
      """
      Returns default QconfigMapping for a given quantization scheme. If a qconfig is passed,
      it is used as the default qconfig instead.
      """
      supported_modules = list(
          set(_get_supported_modules()) - set(_fixed_qparams_modules)
      )
      # Add _FakeQuantize to ensure all fused ops have same qconfig
      supported_modules.append(_aoquant.FakeQuantize)
  
      qconfig_mapping = _aoquant.QConfigMapping()
      default_qconfig_mapping = (
          _aoquant.get_default_qat_qconfig_mapping()
      )
  
      # copy qconfig mapping for fixed qparams
      for key in default_qconfig_mapping.object_type_qconfigs:
          if key in _fixed_qparams_modules:
              qconfig_mapping.set_object_type(
                  key, default_qconfig_mapping.object_type_qconfigs[key]
              )
  
      qconfig = (
          self._get_default_qconfig_from_quantization_scheme(
              quantization_scheme
          )
          if qconfig is None
          else qconfig
      )
  
      qconfig_mapping.set_global(qconfig)
      for mod_type in supported_modules:
          qconfig_mapping.set_object_type(
              mod_type,
              self._adjust_qconfig_for_module_type(mod_type, qconfig),
          )
      return qconfig_mapping
  
file_path: coremltools/coremltools/optimize/torch/quantization/_qconfig_mapping.py
imports: from typing import Any
  from typing import Optional
  import torch
  import torch.ao.quantization
  import torch.nn
  from coremltools.optimize.torch.quantization._backend_config import _fixed_qparams_modules
  from coremltools.optimize.torch.quantization._backend_config import get_supported_modules
  from coremltools.optimize.torch.quantization.quantization_config import LinearQuantizerConfig
  from coremltools.optimize.torch.quantization.quantization_config import ModuleLinearQuantizerConfig
  from coremltools.optimize.torch.quantization.quantization_config import ObserverType
  from coremltools.optimize.torch.quantization.quantization_config import QuantizationScheme
  from coremltools.optimize.torch.quantization.quantization_config import _default_quantization_options
label_desc: Use image node_id 5 for calling the _QConfigMappingBuilder obj's underlying member method code with example usage: obj.get_default_qconfig_mapping(quantization_scheme, qconfig) and returns: qconfig_mapping