Skip to content

Commit 19fd3fd

Browse files
committed
Add minor comment about ToTensor
1 parent bca7a49 commit 19fd3fd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

torchvision/transforms/v2/_deprecated.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class ToTensor(Transform):
1717
.. warning::
1818
:class:`v2.ToTensor` is deprecated and will be removed in a future release.
1919
Please use instead ``v2.Compose([v2.ToImage(), v2.ToDtype(torch.float32, scale=True)])``.
20+
Output is equivalent up to float precision.
2021
2122
This transform does not support torchscript.
2223
@@ -41,6 +42,7 @@ def __init__(self) -> None:
4142
warnings.warn(
4243
"The transform `ToTensor()` is deprecated and will be removed in a future release. "
4344
"Instead, please use `v2.Compose([v2.ToImage(), v2.ToDtype(torch.float32, scale=True)])`."
45+
"Output is equivalent up to float precision."
4446
)
4547
super().__init__()
4648

0 commit comments

Comments
 (0)