class_docstr: Given a batch of input images and labels, this class randomly applies the
  `MixUp transformation <https://arxiv.org/abs/1710.09412>`_
  
  Args:
      opts (argparse.Namespace): Arguments
      num_classes (int): Number of classes in the dataset
code: def _apply_mixup_transform(
      self, image_tensor: Tensor, target_tensor: Tensor
  ) -> Tuple[Tensor, Tensor]:
      if image_tensor.ndim != 4:
          logger.error(
              f"Batch ndim should be 4. Got {image_tensor.ndim}"
          )
      if target_tensor.ndim != 1:
          logger.error(
              f"Target ndim should be 1. Got {target_tensor.ndim}"
          )
      if not image_tensor.is_floating_point():
          logger.error(
              f"Batch datatype should be a float tensor. Got {image_tensor.dtype}."
          )
      if target_tensor.dtype != torch.int64:
          logger.error(
              f"Target datatype should be torch.int64. Got {target_tensor.dtype}"
          )
  
      if not self.inplace:
          image_tensor = image_tensor.clone()
          target_tensor = target_tensor.clone()
  
      if target_tensor.ndim == 1:
          target_tensor = F_torch.one_hot(
              target_tensor, num_classes=self.num_classes
          ).to(dtype=image_tensor.dtype)
  
      # It's faster to roll the batch by one instead of shuffling it to create image pairs
      batch_rolled = image_tensor.roll(1, 0)
      target_rolled = target_tensor.roll(1, 0)
  
      # Implemented as on mixup paper, page 3.
      lambda_param = float(
          torch._sample_dirichlet(
              torch.tensor([self.alpha, self.alpha])
          )[0]
      )
      batch_rolled.mul_(1.0 - lambda_param)
      image_tensor.mul_(lambda_param).add_(batch_rolled)
  
      target_rolled.mul_(1.0 - lambda_param)
      target_tensor.mul_(lambda_param).add_(target_rolled)
      return image_tensor, target_tensor
  
imports: import argparse
  import math
  import random
  from typing import Dict, Tuple
  import torch
  from torch import Tensor
  from torch.nn import functional
  from torchvision.transforms import functional
  from data.transforms import TRANSFORMATIONS_REGISTRY, BaseTransformation
  from utils import logger
label_desc: Use image node_id 3 for calling the RandomMixup obj's underlying member method code with example usage: obj._apply_mixup_transform(image_tensor, target_tensor) and returns: image_tensor,  target_tensor