Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify TVTensor shapes #8260

Closed
mantasu opened this issue Feb 7, 2024 · 2 comments · Fixed by #8262
Closed

Clarify TVTensor shapes #8260

mantasu opened this issue Feb 7, 2024 · 2 comments · Fixed by #8262

Comments

@mantasu
Copy link
Contributor

mantasu commented Feb 7, 2024

📚 The doc issue

TVTensor is documented as being a subclass of torch.Tensor specifically for transforms. Perhaps it could be added that they only constrain the shape of torch.Tensor?

For example, I only use the utility functions of transforms.v2 and, when to_image referred me to Image, I still had to check the source code to confirm it is just a torch.Tensor of shape (C x H x W).

Suggest a potential alternative/fix

No response

@NicolasHug
Copy link
Member

Hi @mantasu , we've added the main relevant info about TVTensors in this tutorial https://pytorch.org/vision/main/auto_examples/transforms/plot_transforms_getting_started.html#what-are-tvtensors which is linked to as the main entrypoint for all things related to TVTensors / TransformsV2. Do you think it already contains the info you were looking for, or should we edit it a bit?

@mantasu
Copy link
Contributor Author

mantasu commented Feb 7, 2024

My only suggestion would be to add somewhere that TVTensors are just extensions of torch.Tensor with specified shape constraints. But it is just a preference and the tutorial already helps a lot, so this could be safely closed~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants