RandomStructured
class torch.nn.utils.prune.RandomStructured(amount, dim=- 1)
Prune entire (currently unpruned) channels in a tensor at random.
Parameters:
      * amount (int or float) -- quantity of parameters to
        prune. If "float", should be between 0.0 and 1.0 and represent
        the fraction of parameters to prune. If "int", it represents
        the absolute number of parameters to prune.
  * **dim** (*int**, **optional*) -- index of the dim along which
    we define channels to prune. Default: -1.

classmethod apply(module, name, amount, dim=- 1)
  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.
