erase¶ torchvision.transforms.functional.erase(img: Tensor, i: int, j: int, h: int, w: int, v: Tensor, inplace: bool = False) → Tensor[source]¶ 使用給定值擦除輸入的 Tensor Image。此變換不支援 PIL Image。 引數: img (Tensor Image) – 要擦除的尺寸為 (C, H, W) 的 Tensor 影像 i (int) – (i,j) 中的 i,即左上角的座標。 j (int) – (i,j) 中的 j,即左上角的座標。 h (int) – 擦除區域的高度。 w (int) – 擦除區域的寬度。 v – 擦除值。 inplace (bool, 可選) – 用於就地操作。預設為 False。 返回: 擦除後的影像。 返回型別: Tensor Image