Skip to content

Commit

Permalink
Clarify scaling of ToTensor transform for target masks in the documen…
Browse files Browse the repository at this point in the history
…tation
  • Loading branch information
Areiser authored and Andreas Reiser committed Jul 25, 2020
1 parent 1aef87d commit c859d7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions torchvision/transforms/transforms.py
Expand Up @@ -73,6 +73,10 @@ class ToTensor(object):
or if the numpy.ndarray has dtype = np.uint8
In the other cases, tensors are returned without scaling.
.. note::
Because the input image is scaled to [0.0, 1.0], this transformation should not be used when
transforming target image masks. See the references for implementing the transforms for image masks.
"""

def __call__(self, pic):
Expand Down

0 comments on commit c859d7e

Please sign in to comment.