-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Add ToPureTensor transform #7823
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments inline. Nothing major so stamping to unblock.
_transformed_types = (datapoints.Image, datapoints.Video, datapoints.Mask, datapoints.BoundingBoxes) | ||
|
||
def _transform(self, inpt: Any, params: Dict[str, Any]) -> torch.Tensor: | ||
return inpt.as_subclass(torch.Tensor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need / want a functional for this. The functional would just wrap .as_subclass(torch.Tensor)
which is already public and users should just use that
Co-authored-by: Philip Meier <github.pmeier@posteo.de>
Hey @NicolasHug! You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py |
Summary: Co-authored-by: Philip Meier <github.pmeier@posteo.de> Reviewed By: matteobettini Differential Revision: D48642260 fbshipit-source-id: c8f287816cc22508274c492703b6938fade169ad
cc @vfdev-5