Skip to content

Commit

Permalink
Add parameter type to to_tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
adamtheturtle committed Feb 5, 2024
1 parent 806dba6 commit a1cd97c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchvision/transforms/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _is_numpy_image(img: Any) -> bool:
return img.ndim in {2, 3}


def to_tensor(pic) -> Tensor:
def to_tensor(pic: Union[Image, np.ndarray]) -> Tensor:
"""Convert a ``PIL Image`` or ``numpy.ndarray`` to tensor.
This function does not support torchscript.
Expand Down

0 comments on commit a1cd97c

Please sign in to comment.