class_docstr: Apply RandAugment :cite:`cubuk2020randaugment` augmentation strategies.
  
  Args:
      n: the number of augmentations to apply sequentially.
      m: magnitude for all the augmentations, ranged from [0, 30].
      policy: candidate transformations. If None, a default candidate list will be used.
      transformation_matrix_mode: computation mode for the chained transformation matrix, via `.transform_matrix`
                                  attribute.
                                  If `silent`, transformation matrix will be computed silently and the non-rigid
                                  modules will be ignored as identity transformations.
                                  If `rigid`, transformation matrix will be computed silently and the non-rigid
                                  modules will trigger errors.
                                  If `skip`, transformation matrix will be totally ignored.
  
  Examples:
      >>> import kornia.augmentation as K
      >>> in_tensor = torch.rand(5, 3, 30, 30)
      >>> aug = K.AugmentationSequential(RandAugment(n=2, m=10))
      >>> aug(in_tensor).shape
      torch.Size([5, 3, 30, 30])
class_docstr_tok: ["Apply","RandAugment",":","cite",":","`","cubuk2020randaugment","`","augmentation","strategies",".","Args",":","n",":","the","number","of","augmentations","to","apply","sequentially",".","m",":","magnitude","for","all","the","augmentations",",","ranged","from","[","0",",","30","]",".","policy",":","candidate","transformations",".","If","None",",","a","default","candidate","list","will","be","used",".","transformation_matrix_mode",":","computation","mode","for","the","chained","transformation","matrix",",","via","`",".transform_matrix","`","attribute",".","If","`","silent","`",",","transformation","matrix","will","be","computed","silently","and","the","non-rigid","modules","will","be","ignored","as","identity","transformations",".","If","`","rigid","`",",","transformation","matrix","will","be","computed","silently","and","the","non-rigid","modules","will","trigger","errors",".","If","`","skip","`",",","transformation","matrix","will","be","totally","ignored",".","Examples",":",">",">",">","import","kornia.augmentation","as","K",">",">",">","in_tensor","=","torch.rand","(","5",",","3",",","30",",","30",")",">",">",">","aug","=","K.AugmentationSequential","(","RandAugment","(","n=2",",","m=10",")",")",">",">",">","aug","(","in_tensor",")",".shape","torch.Size","(","[","5",",","3",",","30",",","30","]",")"]
code: def forward_parameters(
      self, batch_shape: torch.Size
  ) -> List[ParamItem]:
      named_modules: Iterator[
          Tuple[str, Module]
      ] = self.get_forward_sequence()
  
      params: List[ParamItem] = []
      mod_param: Union[Dict[str, Tensor], List[ParamItem]]
      m = torch.tensor([self.m / 30] * batch_shape[0])
  
      for name, module in named_modules:
          # The Input PolicySequential only got one child.
          op = cast(PolicySequential, module)[0]
          op = cast(OperationBase, op)
          mag = None
          if op.magnitude_range is not None:
              minval, maxval = op.magnitude_range
              mag = m * float(maxval - minval) + minval
          mod_param = op.forward_parameters(batch_shape, mag=mag)
          # Compose it
          param = ParamItem(
              name,
              [
                  ParamItem(
                      next(iter(module.named_children()))[0], mod_param
                  )
              ],
          )
          params.append(param)
  
      return params
  
file_path: kornia/kornia/augmentation/auto/rand_augment/rand_augment.py
imports: from typing import Dict, Iterator, List, Optional, Tuple, Union, cast
  import torch
  from torch.distributions import Categorical
  from kornia.augmentation.auto.base import SUBPLOLICY_CONFIG, PolicyAugmentBase
  from kornia.augmentation.auto.operations import OperationBase
  from kornia.augmentation.auto.operations.policy import PolicySequential
  from kornia.augmentation.container.params import ParamItem
  from kornia.core import Module, Tensor
  from .None import ops
label_desc: Use image node_id 4 for calling the RandAugment obj's underlying member method code with example usage: obj.forward_parameters(batch_shape) and returns: params