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: Builds mask dictionary for saving to disk or otherwise
  
  Returns
  -------
  mask_dict
      dictionary containing weight and bias pruning masks
docstr_tok: ["Builds","mask","dictionary","for","saving","to","disk","or","otherwise","Returns","--","--","--","-","mask_dict","dictionary","containing","weight","and","bias","pruning","masks"]
code: def get_mask_dict(self):
      """
      Builds mask dictionary for saving to disk or otherwise
  
      Returns
      -------
      mask_dict
          dictionary containing weight and bias pruning masks
  
      """
      mask_dict = {}
      for wrapper in self.get_modules_wrapper():
          weight_mask = wrapper.weight_mask
          bias_mask = wrapper.bias_mask
          if weight_mask is not None:
              mask_sum = weight_mask.sum().item()
              mask_num = weight_mask.numel()
              _logger.debug(
                  "Layer: %s  Sparsity: %.4f",
                  wrapper.name,
                  1 - mask_sum / mask_num,
              )
              wrapper.module.weight.data = (
                  wrapper.module.weight.data.mul(weight_mask)
              )
          if bias_mask is not None:
              wrapper.module.bias.data = wrapper.module.bias.data.mul(
                  bias_mask
              )
          # save mask to dict
          mask_dict[wrapper.name] = {
              "weight": weight_mask,
              "bias": bias_mask,
          }
      return mask_dict
  
imports: import types
  import logging
  import torch
  from .None import default_layers
label_desc: Use image node_id 6 for calling the Pruner obj's underlying member method code with example usage: obj.get_mask_dict() and returns: mask_dict