class_docstr: Abstract base class for creation of new pruning techniques.
  
  Provides a skeleton for customization requiring the overriding of methods
  such as :meth:`compute_mask` and :meth:`apply`.
class_docstr_tok: ["Abstract","base","class","for","creation","of","new","pruning","techniques",".","Provides","a","skeleton","for","customization","requiring","the","overriding","of","methods","such","as",":","meth",":","`","compute_mask","`","and",":","meth",":","`","apply","`","."]
docstr: Remove the pruning reparameterization from a module.
  
  The pruned parameter named ``name`` remains permanently pruned,
  and the parameter named ``name+'_orig'`` is removed from the parameter list.
  Similarly, the buffer named ``name+'_mask'`` is removed from the buffers.
  
  Note:
      Pruning itself is NOT undone or reversed!
docstr_tok: ["Remove","the","pruning","reparameterization","from","a","module",".","The","pruned","parameter","named","``","name","``","remains","permanently","pruned",",","and","the","parameter","named","``","name+'_orig","'","``","is","removed","from","the","parameter","list",".","Similarly",",","the","buffer","named","``","name+'_mask","'","``","is","removed","from","the","buffers",".","Note",":","Pruning","itself","is","NOT","undone","or","reversed","!"]
code: def remove(self, module):
      r"""Remove the pruning reparameterization from a module.
  
      The pruned parameter named ``name`` remains permanently pruned,
      and the parameter named ``name+'_orig'`` is removed from the parameter list.
      Similarly, the buffer named ``name+'_mask'`` is removed from the buffers.
  
      Note:
          Pruning itself is NOT undone or reversed!
      """
      # before removing pruning from a tensor, it has to have been applied
      assert (
          self._tensor_name is not None
      ), f"Module {module} has to be pruned            before pruning can be removed"  # this gets set in apply()
  
      # to update module[name] to latest trained weights
      weight = self.apply_mask(module)  # masked weights
  
      # delete and reset
      if hasattr(module, self._tensor_name):
          delattr(module, self._tensor_name)
      orig = module._parameters[self._tensor_name + "_orig"]
      orig.data = weight.data
      del module._parameters[self._tensor_name + "_orig"]
      del module._buffers[self._tensor_name + "_mask"]
      setattr(module, self._tensor_name, orig)
  
imports: import numbers
  from abc import ABC, abstractmethod
  from collections.abc import Iterable
  from typing import Tuple
  import torch
label_desc: Use image node_id 6 for calling the BasePruningMethod obj's underlying member method code with example usage: obj.remove(module) without return types