torch.nn.utils.prune.custom_from_mask
torch.nn.utils.prune.custom_from_mask(module, name, mask)
Prunes tensor corresponding to parameter called "name" in "module"
   by applying the pre-computed mask in "mask". Modifies module in
   place (and also return the modified module) by:


adding a named buffer called "name+'_mask'" corresponding to the
      binary mask applied to the parameter "name" by the pruning
      method.


replacing the parameter "name" by its pruned version, while the
      original (unpruned) parameter is stored in a new parameter named
      "name+'_orig'".


Parameters:
      * module (nn.Module) -- module containing the tensor to
        prune
  * **name** (*str*) -- parameter name within "module" on which
    pruning will act.

  * **mask** (*Tensor*) -- binary mask to be applied to the
    parameter.

Returns:
      modified (i.e. pruned) version of the input module
Return type: