Skip to content

Document the subtleties of to/from tensor conversions in a gallery example #4295

Closed
@NicolasHug

Description

@NicolasHug

Our utils for converting to and from tensors (to_tensor, pil_to_tensor, to_pil_image, etc.) are fairly subtle and can sometimes create confusion (#2483 (comment), #3782).

It'd be nice to have a gallery example that exhaustively illustrates the stuff one should be aware of when using them, for example in terms of contiguity, range conversion, dtype, etc. and also explain when to use one over the other; In particular we could try to illustrate the differences between to_tensor and pil_to_tensor on the same set of inputs

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