class_docstr: CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features
  (https://arxiv.org/abs/1905.04899)
class_docstr_tok: ["CutMix",":","Regularization","Strategy","to","Train","Strong","Classifiers","with","Localizable","Features","(","https",":","\/\/arxiv.org\/abs\/1905.04899",")"]
docstr: The input is a batch of samples and their corresponding labels.
  
  Args:
      x (torch.Tensor): Input tensor. The input should be a batch of videos with
          shape (B, C, T, H, W).
      labels (torch.Tensor): Labels for input with shape (B).
docstr_tok: ["The","input","is","a","batch","of","samples","and","their","corresponding","labels",".","Args",":","x","(","torch.Tensor",")",":","Input","tensor",".","The","input","should","be","a","batch","of","videos","with","shape","(","B",",","C",",","T",",","H",",","W",")",".","labels","(","torch.Tensor",")",":","Labels","for","input","with","shape","(","B",")","."]
code: def forward(
      self,
      x_video: torch.Tensor,
      labels: torch.Tensor,
      **args: Any,
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """
      The input is a batch of samples and their corresponding labels.
  
      Args:
          x (torch.Tensor): Input tensor. The input should be a batch of videos with
              shape (B, C, T, H, W).
          labels (torch.Tensor): Labels for input with shape (B).
      """
      assert (
          x_video.size(0) > 1
      ), "Cutmix cannot be applied to a single instance."
      assert (
          x_video.dim() == 4 or x_video.dim() == 5
      ), "Please correct input shape."
      cutmix_lamda = self.cutmix_beta_sampler.sample()
      x_video, cutmix_lamda_corrected = self._cutmix(
          x_video, cutmix_lamda
      )
      new_labels = _mix_labels(
          labels,
          self.num_classes,
          cutmix_lamda_corrected,
          self.label_smoothing,
          one_hot=self.one_hot,
      )
      if args.get("x_audio", None) is not None:
          x_audio = args["x_audio"]
          assert (
              x_audio.size(0) > 1
          ), "Cutmix cannot be applied to a single instance."
          assert (
              x_audio.dim() == 4 or x_audio.dim() == 5
          ), "Please correct input shape."
          x_audio, _ = self._cutmix(x_audio, cutmix_lamda)
          return x_video, x_audio, new_labels
      else:
          return x_video, new_labels
  
file_path: pytorchvideo/pytorchvideo/transforms/mix.py
imports: from typing import Any, Dict, Tuple
  import torch
  from pytorchvideo.transforms.functional import convert_to_one_hot
label_desc: Use image node_id 5 for calling the CutMix obj's underlying member method code with example usage: obj.forward(x_video, labels) and returns: x_video,  x_audio,  new_labels, x_video,  new_labels