Closed
Description
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