Skip to content

[docs] transforms.ToTensor() doesn't rescale pixels of floating-point images #567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
asanakoy opened this issue Aug 3, 2018 · 2 comments · Fixed by #711
Closed

[docs] transforms.ToTensor() doesn't rescale pixels of floating-point images #567

asanakoy opened this issue Aug 3, 2018 · 2 comments · Fixed by #711

Comments

@asanakoy
Copy link

asanakoy commented Aug 3, 2018

I noticed that ToTensor() only rescales pixels of integer-valued images.
If PIL.mode corresponds to the image with the floating-point representation - no scaling to pixel values will be applied.

I think this should be documented in https://pytorch.org/docs/stable/torchvision/transforms.html?highlight=totensor#torchvision.transforms.ToTensor. Otherwise it's too confusing.

Related to: #546

@fmassa
Copy link
Member

fmassa commented Aug 3, 2018

Yes, it should definitely be documented.
As I've mentioned in #546, I think we should do something to mitigate this inconsistency.

Could you send a PR improving the documentation?

@asanakoy
Copy link
Author

asanakoy commented Aug 3, 2018

Yes, sure. I will send a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants