Table of Contents
Shortcuts

# erase

torchvision.transforms.functional.erase(img: Tensor, i: int, j: int, h: int, w: int, v: Tensor, inplace: bool = False) → Tensor

  Erase the input Tensor Image with given value. This transform does not support PIL Image.

  Parameters:

    - img (Tensor Image) – Tensor image of size (C, H, W) to be erased

    - i (int) – i in (i,j) i.e coordinates of the upper left corner.

    - j (int) – j in (i,j) i.e coordinates of the upper left corner.

    - h (int) – Height of the erased region.

    - w (int) – Width of the erased region.

    - v – Erasing value.

    - inplace (bool, optional) – For in-place operations. By default, is set False.

  Returns:

    Erased image.

  Return type:

    Tensor Image

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.