class_docstr: Base quantizer for pytorch quantizer
docstr: Create a wrapper forward function to replace the original one.
  Parameters
  ----------
  layer : LayerInfo
      the layer to instrument the mask
  config : dict
      the configuration for quantization
docstr_tok: ["Create","a","wrapper","forward","function","to","replace","the","original","one",".","Parameters","--","--","--","--","--","layer",":","LayerInfo","the","layer","to","instrument","the","mask","config",":","dict","the","configuration","for","quantization"]
code: def _wrap_modules(self, layer, config):
      """
      Create a wrapper forward function to replace the original one.
      Parameters
      ----------
      layer : LayerInfo
          the layer to instrument the mask
      config : dict
          the configuration for quantization
      """
      assert (
          "quant_types" in config
      ), "must provide quant_types in config"
      assert isinstance(
          config["quant_types"], list
      ), "quant_types must be list type"
      assert "quant_bits" in config, "must provide quant_bits in config"
      assert isinstance(config["quant_bits"], int) or isinstance(
          config["quant_bits"], dict
      ), "quant_bits must be dict type or int type"
  
      if isinstance(config["quant_bits"], dict):
          for quant_type in config["quant_types"]:
              assert quant_type in config["quant_bits"], (
                  "bits length for %s must be specified in quant_bits dict"
                  % quant_type
              )
  
      return QuantizerModuleWrapper(
          layer.module, layer.name, layer.type, config, self
      )
  
imports: import types
  import logging
  import torch
  from .None import default_layers
label_desc: Use image node_id 5 for calling the Quantizer obj's underlying member method code with example usage: obj._wrap_modules(layer, config) and returns: QuantizerModuleWrapper