class_docstr: Apply MixUp to the provided batch of images and labels.
  
  Paper: `mixup: Beyond Empirical Risk Minimization <https://arxiv.org/abs/1710.09412>`_.
  
  .. note::
      This transform is meant to be used on **batches** of samples, not
      individual images. See
      :ref:`sphx_glr_auto_examples_transforms_plot_cutmix_mixup.py` for detailed usage
      examples.
      The sample pairing is deterministic and done by matching consecutive
      samples in the batch, so the batch needs to be shuffled (this is an
      implementation detail, not a guaranteed convention.)
  
  In the input, the labels are expected to be a tensor of shape ``(batch_size,)``. They will be transformed
  into a tensor of shape ``(batch_size, num_classes)``.
  
  Args:
      alpha (float, optional): hyperparameter of the Beta distribution used for mixup. Default is 1.
      num_classes (int): number of classes in the batch. Used for one-hot-encoding.
      labels_getter (callable or "default", optional): indicates how to identify the labels in the input.
          By default, this will pick the second parameter as the labels if it's a tensor. This covers the most
          common scenario where this transform is called as ``MixUp()(imgs_batch, labels_batch)``.
          It can also be a callable that takes the same input as the transform, and returns the labels.
class_docstr_tok: ["Apply","MixUp","to","the","provided","batch","of","images","and","labels",".","Paper",":","`","mixup",":","Beyond","Empirical","Risk","Minimization","<","https",":","\/\/arxiv.org\/abs\/1710.09412",">","`","_",".","..","note",":",":","This","transform","is","meant","to","be","used","on","*","*","batches","*","*","of","samples",",","not","individual","images",".","See",":","ref",":","`","sphx_glr_auto_examples_transforms_plot_cutmix_mixup.py","`","for","detailed","usage","examples",".","The","sample","pairing","is","deterministic","and","done","by","matching","consecutive","samples","in","the","batch",",","so","the","batch","needs","to","be","shuffled","(","this","is","an","implementation","detail",",","not","a","guaranteed","convention",".",")","In","the","input",",","the","labels","are","expected","to","be","a","tensor","of","shape","``","(","batch_size",",",")","``",".","They","will","be","transformed","into","a","tensor","of","shape","``","(","batch_size",",","num_classes",")","``",".","Args",":","alpha","(","float",",","optional",")",":","hyperparameter","of","the","Beta","distribution","used","for","mixup",".","Default","is","1.","num_classes","(","int",")",":","number","of","classes","in","the","batch",".","Used","for","one-hot-encoding",".","labels_getter","(","callable","or","``","default","''",",","optional",")",":","indicates","how","to","identify","the","labels","in","the","input",".","By","default",",","this","will","pick","the","second","parameter","as","the","labels","if","it","'s","a","tensor",".","This","covers","the","most","common","scenario","where","this","transform","is","called","as","``","MixUp","(",")","(","imgs_batch",",","labels_batch",")","``",".","It","can","also","be","a","callable","that","takes","the","same","input","as","the","transform",",","and","returns","the","labels","."]
code: def _get_params(self, flat_inputs: List[Any]) -> Dict[str, Any]:
      return dict(lam=float(self._dist.sample(())))
  
imports: import math
  import numbers
  import warnings
  from typing import Any, Callable, Dict, List, Tuple
  import PIL.Image
  import torch
  from torch.nn.functional import one_hot
  from torch.utils._pytree import tree_flatten, tree_unflatten
  from torchvision import transforms, tv_tensors
  from torchvision.transforms.v2 import functional
  from ._transform import _RandomApplyTransform, Transform
  from ._utils import _parse_labels_getter, has_any, is_pure_tensor, query_chw, query_size
label_desc: Use image node_id 1 for calling the MixUp obj's underlying member method code with example usage: obj._get_params(flat_inputs) and returns: dict