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

Created on 3 Aug 2018  路  2Comments  路  Source: pytorch/vision

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: https://github.com/pytorch/vision/issues/546

enhancement help wanted

Most helpful comment

Yes, sure. I will send a PR.

All 2 comments

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?

Yes, sure. I will send a PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

datumbox picture datumbox  路  3Comments

ibtingzon picture ibtingzon  路  3Comments

IssamLaradji picture IssamLaradji  路  3Comments

alpha-gradient picture alpha-gradient  路  3Comments

martinarjovsky picture martinarjovsky  路  4Comments