Skip to content

[docs] Table of accepted image tensor dtypes for all transforms #5294

Open
@vadimkantorov

Description

@vadimkantorov

📚 The doc issue

Many transforms support equally float32 and uint8, but it seems not documented. Or sometimes some image formats aren't supported but it's not clear why so: e.g. torchvision.transforms.functional.normalize throws when given a uint8 image, but there seems no big reason why it can't autocast uint8 inputs to float32 (just as most pytorch core ops do now).

Sometimes uint8 can be more convenient since it saves memory or sometimes even int16 is necessary: https://discuss.pytorch.org/t/colorjitter-transformation-for-16-bit-images/108897. Uint8 images are also more convenient for no-copy interop with OpenCV or PIL.

Suggest a potential alternative/fix

No response

Activity

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

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