class_docstr: Generate cutmix indexes and lambdas for a batch of inputs.
  
  Args:
      p (float): probability of applying cutmix.
      num_mix (int): number of images to mix with. Default is 1.
      beta (torch.Tensor, optional): hyperparameter for generating cut size from beta distribution.
          If None, it will be set to 1.
      cut_size (torch.Tensor, optional): controlling the minimum and maximum cut ratio from [0, 1].
          If None, it will be set to [0, 1], which means no restriction.
  
  Returns:
      params Dict[str, torch.Tensor]: parameters to be passed for transformation.
          - mix_pairs (torch.Tensor): element-wise probabilities with a shape of (num_mix, B).
          - crop_src (torch.Tensor): element-wise probabilities with a shape of (num_mix, B, 4, 2).
  
  Note:
      The generated random numbers are not reproducible across different devices and dtypes. By default,
      the parameters will be generated on CPU in float32. This can be changed by calling
      ``self.set_rng_device_and_dtype(device="cuda", dtype=torch.float64)``.
code: def __init__(
      self,
      cut_size: Optional[
          Union[torch.Tensor, Tuple[float, float]]
      ] = None,
      beta: Optional[Union[torch.Tensor, float]] = None,
      num_mix: int = 1,
      p: float = 1.0,
  ) -> None:
      super().__init__()
      self.cut_size = cut_size
      self.beta = beta
      self.num_mix = num_mix
      self.p = p
  
      if not (num_mix >= 1 and isinstance(num_mix, (int,))):
          raise AssertionError(
              f"`num_mix` must be an integer greater than 1. Got {num_mix}."
          )
  
file_path: kornia/kornia/augmentation/random_generator/_2d/cutmix.py
imports: from typing import Dict, Optional, Tuple, Union
  import torch
  from torch.distributions import Bernoulli, Beta, Uniform
  from kornia.augmentation.random_generator.base import RandomGeneratorBase
  from kornia.augmentation.utils import _adapted_rsampling, _adapted_sampling, _common_param_check, _joint_range_check
  from kornia.core import as_tensor, tensor, zeros
  from kornia.geometry.bbox import bbox_generator
  from kornia.utils.helpers import _extract_device_dtype
label_desc: Use image node_id 1 to create a new CutmixGenerator object from inherited base classes: RandomGeneratorBase with example: obj = CutmixGenerator(cut_size, beta, num_mix, p)