class_docstr: Erase a random rectangle of a tensor image according to a probability p value.
  
  .. image:: _static/img/RandomErasing.png
  
  The operator removes image parts and fills them with zero values at a selected rectangle
  for each of the images in the batch.
  
  The rectangle will have an area equal to the original image area multiplied by a value uniformly
  sampled between the range [scale[0], scale[1]) and an aspect ratio sampled
  between [ratio[0], ratio[1])
  
  Args:
      scale: range of proportion of erased area against input image.
      ratio: range of aspect ratio of erased area.
      value: the value to fill the erased area.
      same_on_batch: apply the same transformation across the batch.
      p: probability that the random erasing operation will be performed.
      keepdim: whether to keep the output shape the same as input (True) or broadcast it
                      to the batch form (False).
  
  Shape:
      - Input: :math:`(C, H, W)` or :math:`(B, C, H, W)`, Optional: :math:`(B, 3, 3)`
      - Output: :math:`(B, C, H, W)`
  
  Note:
      Input tensor must be float and normalized into [0, 1] for the best differentiability support.
      Additionally, this function accepts another transformation tensor (:math:`(B, 3, 3)`), then the
      applied transformation will be merged int to the input transformation tensor and returned.
  
  Examples:
      >>> rng = torch.manual_seed(0)
      >>> inputs = torch.ones(1, 1, 3, 3)
      >>> aug = RandomErasing((.4, .8), (.3, 1/.3), p=0.5)
      >>> aug(inputs)
      tensor([[[[1., 0., 0.],
                [1., 0., 0.],
                [1., 0., 0.]]]])
  
  To apply the exact augmenation again, you may take the advantage of the previous parameter state:
      >>> input = torch.randn(1, 3, 32, 32)
      >>> aug = RandomErasing((.4, .8), (.3, 1/.3), p=1.)
      >>> (aug(input) == aug(input, params=aug._params)).all()
      tensor(True)
code: def __init__(
      self,
      scale: Union[Tensor, Tuple[float, float]] = (0.02, 0.33),
      ratio: Union[Tensor, Tuple[float, float]] = (0.3, 3.3),
      value: float = 0.0,
      same_on_batch: bool = False,
      p: float = 0.5,
      keepdim: bool = False,
  ) -> None:
      super().__init__(
          p=p, same_on_batch=same_on_batch, keepdim=keepdim
      )
      self.scale = scale
      self.ratio = ratio
      self.value = value
      self._param_generator = rg.RectangleEraseGenerator(
          scale, ratio, value
      )
  
file_path: kornia/kornia/augmentation/_2d/intensity/erasing.py
imports: from typing import Any, Dict, Optional, Tuple, Union
  from kornia.augmentation import random_generator
  from kornia.augmentation._2d.intensity.base import IntensityAugmentationBase2D
  from kornia.core import Tensor, where
  from kornia.geometry.bbox import bbox_generator, bbox_to_mask
label_desc: Use image node_id 1 to create a new RandomErasing object from inherited base classes: IntensityAugmentationBase2D with example: obj = RandomErasing(scale, ratio, value, same_on_batch, p, keepdim)