class_docstr: Mapping from model ops to :class:`torch.ao.quantization.QConfig` s.
  
  The user can specify QConfigs using the following methods (in increasing match priority):
  
      ``set_global`` : sets the global (default) QConfig
  
      ``set_object_type`` : sets the QConfig for a given module type, function, or method name
  
      ``set_module_name_regex`` : sets the QConfig for modules matching the given regex string
  
      ``set_module_name`` : sets the QConfig for modules matching the given module name
  
      ``set_module_name_object_type_order`` : sets the QConfig for modules matching a combination
      of the given module name, object type, and the index at which the module appears
  
  Example usage::
  
      qconfig_mapping = QConfigMapping()
          .set_global(global_qconfig)
          .set_object_type(torch.nn.Linear, qconfig1)
          .set_object_type(torch.nn.ReLU, qconfig1)
          .set_module_name_regex("foo.*bar.*conv[0-9]+", qconfig1)
          .set_module_name_regex("foo.*", qconfig2)
          .set_module_name("module1", qconfig1)
          .set_module_name("module2", qconfig2)
          .set_module_name_object_type_order("foo.bar", torch.nn.functional.linear, 0, qconfig3)
docstr: Set the QConfig for modules matching the given regex string.
  
  Regexes will be matched in the order in which they are registered through this method.
  Thus, the caller should register more specific patterns first, e.g.::
  
      qconfig_mapping = QConfigMapping()
          .set_module_name_regex("foo.*bar.*conv[0-9]+", qconfig1)
          .set_module_name_regex("foo.*bar.*", qconfig2)
          .set_module_name_regex("foo.*", qconfig3)
  
  In this example, "foo.bar.conv0" would match qconfig1, "foo.bar.linear" would match qconfig2,
  and "foo.baz.relu" would match qconfig3.
  
  If the QConfig for an existing module name regex was already set, the new QConfig will override the
  old one while preserving the order in which the regexes were originally registered.
docstr_tok: ["Set","the","QConfig","for","modules","matching","the","given","regex","string",".","Regexes","will","be","matched","in","the","order","in","which","they","are","registered","through","this","method",".","Thus",",","the","caller","should","register","more","specific","patterns","first",",","e.g",".",":",":","qconfig_mapping","=","QConfigMapping","(",")",".set_module_name_regex","(","``","foo.","*","bar",".","*","conv","[","0-9","]","+","''",",","qconfig1",")",".set_module_name_regex","(","``","foo.","*","bar",".","*","''",",","qconfig2",")",".set_module_name_regex","(","``","foo",".","*","''",",","qconfig3",")","In","this","example",",","``","foo.bar.conv0","''","would","match","qconfig1",",","``","foo.bar.linear","''","would","match","qconfig2",",","and","``","foo.baz.relu","''","would","match","qconfig3",".","If","the","QConfig","for","an","existing","module","name","regex","was","already","set",",","the","new","QConfig","will","override","the","old","one","while","preserving","the","order","in","which","the","regexes","were","originally","registered","."]
code: def set_module_name_regex(
      self, module_name_regex: str, qconfig: QConfigAny
  ) -> QConfigMapping:
      """
      Set the QConfig for modules matching the given regex string.
  
      Regexes will be matched in the order in which they are registered through this method.
      Thus, the caller should register more specific patterns first, e.g.::
  
          qconfig_mapping = QConfigMapping()
              .set_module_name_regex("foo.*bar.*conv[0-9]+", qconfig1)
              .set_module_name_regex("foo.*bar.*", qconfig2)
              .set_module_name_regex("foo.*", qconfig3)
  
      In this example, "foo.bar.conv0" would match qconfig1, "foo.bar.linear" would match qconfig2,
      and "foo.baz.relu" would match qconfig3.
  
      If the QConfig for an existing module name regex was already set, the new QConfig will override the
      old one while preserving the order in which the regexes were originally registered.
      """
      self.module_name_regex_qconfigs[module_name_regex] = qconfig
      return self
  
imports: from __future__ import annotations
  from collections import OrderedDict
  from typing import Any, Callable, Dict, Tuple, Union, List
  import torch
  from .fake_quantize import default_weight_fake_quant, FixedQParamsFakeQuantize
  from .observer import _PartialWrapper, default_fixed_qparams_range_0to1_observer, default_fixed_qparams_range_neg1to1_observer, default_placeholder_observer, default_weight_observer
  from .qconfig import default_reuse_input_qconfig, default_symmetric_qnnpack_qconfig, default_symmetric_qnnpack_qat_qconfig, get_default_qconfig, get_default_qat_qconfig, QConfig, QConfigAny, default_quint8_weight_qconfig
label_desc: Use image node_id 4 for calling the QConfigMapping obj's underlying member method code with example usage: obj.set_module_name_regex(module_name_regex, qconfig) and returns: self