-
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
make datapoints deepcopyable #7701
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.
Thanks Philip, just Qs because I don't fully understand the memo
stuff, but mostly LGTM
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.
Thanks Philip, LGTM
Hey @pmeier! 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 |
Reviewed By: vmoens Differential Revision: D47186567 fbshipit-source-id: a7d313c8ef1a4fd5d41f8bff8057c0bff666b81a
Fixes #6478.
This PR does three things:
test_prototype_datapoints.py
intotest_datapoints.py
. The only prototype datapoints are the labels. However, all tests in the file were independent of labels, since they were just used as example. I refactored them to use images instead.Tensor.detach
to the list of ops that will not unwrap a datapoint, e.g.Image.detach
will give you back anImage
rather than aTensor
. This is not a requirement for the overall goal of this PR, but something that I found along the way.__deepcopy__
method to the datapoints according to 2. in datapoints cannot be deepcopied #6478.