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 authored Feb 2, 2024
1 parent 806dba6 commit cd92de4
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: 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 cd92de4

Please sign in to comment.