Skip to content

Commit

Permalink
Add minor comment about ToTensor (#8300)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug authored Mar 13, 2024
1 parent bdd690e commit dd66a9d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torchvision/transforms/v2/_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ToTensor(Transform):
.. warning::
:class:`v2.ToTensor` is deprecated and will be removed in a future release.
Please use instead ``v2.Compose([v2.ToImage(), v2.ToDtype(torch.float32, scale=True)])``.
Output is equivalent up to float precision.
This transform does not support torchscript.
Expand All @@ -41,6 +42,7 @@ def __init__(self) -> None:
warnings.warn(
"The transform `ToTensor()` is deprecated and will be removed in a future release. "
"Instead, please use `v2.Compose([v2.ToImage(), v2.ToDtype(torch.float32, scale=True)])`."
"Output is equivalent up to float precision."
)
super().__init__()

Expand Down

0 comments on commit dd66a9d

Please sign in to comment.