Skip to content

Commit 9945468

Browse files
authored
Update input type annotations for resize and pad functions
1 parent 63aa0eb commit 9945468

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/transforms/v2/functional/_geometry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def _compute_resized_output_size(
236236

237237

238238
def resize(
239-
inpt: torch.Tensor,
239+
inpt: Union[PIL.Image.Image, torch.Tensor],
240240
size: Optional[list[int]],
241241
interpolation: Union[InterpolationMode, int] = InterpolationMode.BILINEAR,
242242
max_size: Optional[int] = None,
@@ -1509,7 +1509,7 @@ def rotate_video(
15091509

15101510

15111511
def pad(
1512-
inpt: Union[Image.Image, torch.Tensor],
1512+
inpt: Union[PIL.Image.Image, torch.Tensor],
15131513
padding: list[int],
15141514
fill: Optional[Union[int, float, list[float]]] = None,
15151515
padding_mode: str = "constant",

0 commit comments

Comments
 (0)