class_docstr: Builds py:class:`QConfigMapping` from :py:class:`LinearQuantizerConfig`.
class_docstr_tok: ["Builds","py",":","class",":","`","QConfigMapping","`","from",":","py",":","class",":","`","LinearQuantizerConfig","`","."]
docstr: When layers are fused and we want to skip quantization for a convolution
  or linear layer, we need to set the qconfig for the layer being fused as None
  as well.
docstr_tok: ["When","layers","are","fused","and","we","want","to","skip","quantization","for","a","convolution","or","linear","layer",",","we","need","to","set","the","qconfig","for","the","layer","being","fused","as","None","as","well","."]
code: def _get_module_names_for_setting_qconfig(
      model: _nn.Module, mod_name: str
  ):
      """
      When layers are fused and we want to skip quantization for a convolution
      or linear layer, we need to set the qconfig for the layer being fused as None
      as well.
      """
      try:
          submod = model.get_submodule(mod_name)
      except AttributeError:
          return (mod_name,)
  
      if isinstance(submod, _torch.nn.Conv2d):
          return mod_name, f"{mod_name}.conv"
      elif isinstance(submod, _torch.nn.Linear):
          return mod_name, f"{mod_name}.linear"
      return (mod_name,)
  
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 3 for calling the _QConfigMappingBuilder obj's underlying member method code with example usage: obj._get_module_names_for_setting_qconfig(model, mod_name) and returns: mod_name, mod_name,  mod_name, str, mod_name, mod_name,  mod_name, str