Skip to content

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

Closed
@asanakoy

Description

@asanakoy

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions