erase¶ torchvision.transforms.functional.erase(img: Tensor, i: int, j: int, h: int, w: int, v: Tensor, inplace: bool = False) → Tensor[源代码]¶ 使用给定值擦除输入 Tensor Image。此转换不支持 PIL Image。 参数: img (Tensor Image) – 需要被擦除的 Tensor Image,大小为 (C, H, W) i (int) – (i,j) 中的 i,即左上角的坐标。 j (int) – (i,j) 中的 j,即左上角的坐标。 h (int) – 被擦除区域的高度。 w (int) – 被擦除区域的宽度。 v – 擦除值。 inplace (bool, optional) – 用于原地操作。默认为 False。 返回: 擦除后的图像。 返回类型: Tensor Image