class_docstr: Prune to an exact pruning level specification
  
  Attributes
  ----------
  mask_dict : dict
      Dictionary for saving masks, `key` should be layer name and
      `value` should be a tensor which has the same shape with layer's weight
docstr: Create a wrapper module to replace the original one.
  
  Parameters
  ----------
  layer : LayerInfo
      the layer to instrument the mask
  config : dict
      the configuration for generating the mask
docstr_tok: ["Create","a","wrapper","module","to","replace","the","original","one",".","Parameters","--","--","--","--","--","layer",":","LayerInfo","the","layer","to","instrument","the","mask","config",":","dict","the","configuration","for","generating","the","mask"]
code: def _wrap_modules(self, layer, config):
      """
      Create a wrapper module to replace the original one.
  
      Parameters
      ----------
      layer : LayerInfo
          the layer to instrument the mask
      config : dict
          the configuration for generating the mask
      """
      _logger.debug("Module detected to compress : %s.", layer.name)
      wrapper = PrunerModuleWrapper(
          layer.module, layer.name, layer.type, config, self
      )
      assert hasattr(layer.module, "weight"), (
          "module %s does not have 'weight' attribute" % layer.name
      )
      # move newly registered buffers to the same device of weight
      wrapper.to(layer.module.weight.device)
      return wrapper
  
imports: import types
  import logging
  import torch
  from .None import default_layers
label_desc: Use image node_id 5 for calling the Pruner obj's underlying member method code with example usage: obj._wrap_modules(layer, config) and returns: wrapper