class_docstr: Randomly apply CutMix to the provided batch and targets.
  The class implements the data augmentations as described in the paper
  `"CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features"
  <https://arxiv.org/abs/1905.04899>`_.
  
  Args:
      num_classes (int): number of classes used for one-hot encoding.
      p (float): probability of the batch being transformed. Default value is 0.5.
      alpha (float): hyperparameter of the Beta distribution used for cutmix.
          Default value is 1.0.
      inplace (bool): boolean to make this transform inplace. Default set to False.
class_docstr_tok: ["Randomly","apply","CutMix","to","the","provided","batch","and","targets",".","The","class","implements","the","data","augmentations","as","described","in","the","paper","`","``","CutMix",":","Regularization","Strategy","to","Train","Strong","Classifiers","with","Localizable","Features","''","<","https",":","\/\/arxiv.org\/abs\/1905.04899",">","`","_",".","Args",":","num_classes","(","int",")",":","number","of","classes","used","for","one-hot","encoding",".","p","(","float",")",":","probability","of","the","batch","being","transformed",".","Default","value","is","0.5.","alpha","(","float",")",":","hyperparameter","of","the","Beta","distribution","used","for","cutmix",".","Default","value","is","1.0.","inplace","(","bool",")",":","boolean","to","make","this","transform","inplace",".","Default","set","to","False","."]
code: def __init__(
      self,
      num_classes: int,
      p: float = 0.5,
      alpha: float = 1.0,
      inplace: bool = False,
  ) -> None:
      super().__init__()
      if num_classes < 1:
          raise ValueError(
              "Please provide a valid positive value for the num_classes."
          )
      if alpha <= 0:
          raise ValueError("Alpha param can't be zero.")
  
      self.num_classes = num_classes
      self.p = p
      self.alpha = alpha
      self.inplace = inplace
  
file_path: vision/references/classification/transforms.py
imports: import math
  from typing import Tuple
  import torch
  from presets import get_module
  from torch import Tensor
  from torchvision.transforms import functional
label_desc: Use image node_id 1 to create a new RandomCutMix object from inherited base classes: torch.nn with example: obj = RandomCutMix(num_classes, p, alpha, inplace)