class_docstr: Mixup/Cutmix that applies different params to each element or whole batch
  Args:
      mixup_alpha (float): mixup alpha value, mixup is active if > 0.
      cutmix_alpha (float): cutmix alpha value, cutmix is active if > 0.
      cutmix_minmax (List[float]): cutmix min/max image ratio, cutmix is
      active and uses this vs alpha if not None.
      prob (float): probability of applying mixup or cutmix per batch or
      element
      switch_prob (float): probability of switching to cutmix instead of
      mixup when both are active
      mode (str): how to apply mixup/cutmix params (per 'batch', 'pair' (pair
      of elements), 'elem' (element)
      correct_lam (bool): apply lambda correction when cutmix bbox clipped by
      image borders
      label_smoothing (float): apply label smoothing to the mixed target
      tensor
      num_classes (int): number of classes for target
class_docstr_tok: ["Mixup\/Cutmix","that","applies","different","params","to","each","element","or","whole","batch","Args",":","mixup_alpha","(","float",")",":","mixup","alpha","value",",","mixup","is","active","if",">","0.","cutmix_alpha","(","float",")",":","cutmix","alpha","value",",","cutmix","is","active","if",">","0.","cutmix_minmax","(","List","[","float","]",")",":","cutmix","min\/max","image","ratio",",","cutmix","is","active","and","uses","this","vs","alpha","if","not","None",".","prob","(","float",")",":","probability","of","applying","mixup","or","cutmix","per","batch","or","element","switch_prob","(","float",")",":","probability","of","switching","to","cutmix","instead","of","mixup","when","both","are","active","mode","(","str",")",":","how","to","apply","mixup\/cutmix","params","(","per","'batch","'",",","'pair","'","(","pair","of","elements",")",",","'elem","'","(","element",")","correct_lam","(","bool",")",":","apply","lambda","correction","when","cutmix","bbox","clipped","by","image","borders","label_smoothing","(","float",")",":","apply","label","smoothing","to","the","mixed","target","tensor","num_classes","(","int",")",":","number","of","classes","for","target"]
code: def _mix_batch(self, x):
      lam, use_cutmix = self._params_per_batch()
      if lam == 1.0:
          return 1.0
      if use_cutmix:
          (yl, yh, xl, xh), lam = cutmix_bbox_and_lam(
              x.shape,
              lam,
              ratio_minmax=self.cutmix_minmax,
              correct_lam=self.correct_lam,
          )
          x[:, :, yl:yh, xl:xh] = x.flip(0)[:, :, yl:yh, xl:xh]
      else:
          x_flipped = x.flip(0).mul_(1.0 - lam)
          x.mul_(lam).add_(x_flipped)
      return lam
  
imports: import collections.abc
  from typing import Any, Dict, Optional
  import numpy
  import torch
  from classy_vision.generic.util import convert_to_one_hot
  from torch.distributions.beta import Beta
  from vissl.data.collators import register_collator
  from .moco_collator import moco_collator
  from .simclr_collator import simclr_collator
label_desc: Use image node_id 6 for calling the Mixup obj's underlying member method code with example usage: obj._mix_batch(x) and returns: lam, int