Shortcuts

erase

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

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