BasePruningMethod
class torch.nn.utils.prune.BasePruningMethod
Abstract base class for creation of new pruning techniques.
Provides a skeleton for customization requiring the overriding of
   methods such as "compute_mask()" and "apply()".
classmethod apply(module, name, args, importance_scores=None, *kwargs)
  Adds the forward pre-hook that enables pruning on the fly and
  the reparametrization of a tensor in terms of the original
  tensor and the pruning mask.

  Parameters:
     * **module** (*nn.Module*) -- module containing the tensor to
       prune

     * **name** (*str*) -- parameter name within "module" on which
       pruning will act.

     * **args** -- arguments passed on to a subclass of
       "BasePruningMethod"

     * **importance_scores** (*torch.Tensor*) -- tensor of
       importance scores (of same shape as module parameter) used
       to compute mask for pruning. The values in this tensor
