class_docstr: RandAugment data augmentation method based on
  `"RandAugment: Practical automated data augmentation with a reduced search space"
  <https://arxiv.org/abs/1909.13719>`_.
  If the image is torch Tensor, it should be of type torch.uint8, and it is expected
  to have [..., 1 or 3, H, W] shape, where ... means an arbitrary number of leading dimensions.
  If img is PIL Image, it is expected to be in mode "L" or "RGB".
  
  Args:
      num_ops (int): Number of augmentation transformations to apply sequentially.
      magnitude (int): Magnitude for all the transformations.
      num_magnitude_bins (int): The number of different magnitude values.
      interpolation (InterpolationMode): Desired interpolation enum defined by
          :class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.NEAREST``.
          If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
      fill (sequence or number, optional): Pixel fill value for the area outside the transformed
          image. If given a number, the value is used for all bands respectively.
docstr:     img (PIL Image or Tensor): Image to be transformed.
  
  Returns:
      PIL Image or Tensor: Transformed image.
docstr_tok: ["img","(","PIL","Image","or","Tensor",")",":","Image","to","be","transformed",".","Returns",":","PIL","Image","or","Tensor",":","Transformed","image","."]
code: def forward(self, img: Tensor) -> Tensor:
      """
          img (PIL Image or Tensor): Image to be transformed.
  
      Returns:
          PIL Image or Tensor: Transformed image.
      """
      fill = self.fill
      channels, height, width = F.get_dimensions(img)
      if isinstance(img, Tensor):
          if isinstance(fill, (int, float)):
              fill = [float(fill)] * channels
          elif fill is not None:
              fill = [float(f) for f in fill]
  
      op_meta = self._augmentation_space(
          self.num_magnitude_bins, (height, width)
      )
      for _ in range(self.num_ops):
          op_index = int(torch.randint(len(op_meta), (1,)).item())
          op_name = list(op_meta.keys())[op_index]
          magnitudes, signed = op_meta[op_name]
          magnitude = (
              float(magnitudes[self.magnitude].item())
              if magnitudes.ndim > 0
              else 0.0
          )
          if signed and torch.randint(2, (1,)):
              magnitude *= -1.0
          img = _apply_op(
              img,
              op_name,
              magnitude,
              interpolation=self.interpolation,
              fill=fill,
          )
  
      return img
  
imports: import math
  from enum import Enum
  from typing import Dict, List, Optional, Tuple
  import torch
  from torch import Tensor
  from .None import functional, InterpolationMode
label_desc: Use image node_id 3 for calling the RandAugment obj's underlying member method code with example usage: obj.forward(img) and returns: img