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

make datapoints deepcopyable #7701

Merged
merged 4 commits into from
Jun 27, 2023
Merged

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Jun 27, 2023

Fixes #6478.

This PR does three things:

  1. Merge test_prototype_datapoints.py into test_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.
  2. Add Tensor.detach to the list of ops that will not unwrap a datapoint, e.g. Image.detach will give you back an Image rather than a Tensor. This is not a requirement for the overall goal of this PR, but something that I found along the way.
  3. Add a __deepcopy__ method to the datapoints according to 2. in datapoints cannot be deepcopied #6478.

@pytorch-bot
Copy link

pytorch-bot bot commented Jun 27, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/7701

Note: Links to docs will display an error until the docs builds have been completed.

❌ 30 New Failures

As of commit 35aefbf:

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Copy link
Member

@NicolasHug NicolasHug left a 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

@pmeier pmeier requested a review from NicolasHug June 27, 2023 11:29
Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Philip, LGTM

@pmeier pmeier merged commit d814772 into pytorch:main Jun 27, 2023
@pmeier pmeier deleted the datapoints-deepcopy branch June 27, 2023 12:54
@github-actions
Copy link

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

facebook-github-bot pushed a commit that referenced this pull request Jul 3, 2023
Reviewed By: vmoens

Differential Revision: D47186567

fbshipit-source-id: a7d313c8ef1a4fd5d41f8bff8057c0bff666b81a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

datapoints cannot be deepcopied
3 participants