class_docstr: Prune entire (currently unpruned) channels in a tensor at random.
  
  Args:
      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.
class_docstr_tok: ["Prune","entire","(","currently","unpruned",")","channels","in","a","tensor","at","random",".","Args",":","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","."]
docstr: Add pruning on the fly and reparametrization of a tensor.
  
  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.
  
  Args:
      module (nn.Module): module containing the tensor to prune
      name (str): parameter name within ``module`` on which pruning
          will act.
      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.
docstr_tok: ["Add","pruning","on","the","fly","and","reparametrization","of","a","tensor",".","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",".","Args",":","module","(","nn.Module",")",":","module","containing","the","tensor","to","prune","name","(","str",")",":","parameter","name","within","``","module","``","on","which","pruning","will","act",".","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","."]
code: def apply(cls, module, name, amount, dim=-1):
      r"""Add pruning on the fly and reparametrization of a tensor.
  
      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.
  
      Args:
          module (nn.Module): module containing the tensor to prune
          name (str): parameter name within ``module`` on which pruning
              will act.
          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.
      """
      return super().apply(module, name, amount=amount, dim=dim)
  
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 3 for calling the RandomStructured obj's underlying member method code with example usage: obj.apply(cls, module, name, amount, dim) and returns: super