Skip to content

.item() added to the 'target' variable in fakedataset.py #3587

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

Merged
merged 3 commits into from
Mar 20, 2021

Conversation

avijit9
Copy link
Contributor

@avijit9 avijit9 commented Mar 18, 2021

solves #3517

@avijit9
Copy link
Contributor Author

avijit9 commented Mar 18, 2021

cc @pmeier do I need to add any unit test case for this?

@pmeier
Copy link
Collaborator

pmeier commented Mar 19, 2021

@avijit9

do I need to add any unit test case for this?

We recently added tests for most of our datasets. In fact, the one for FakeData is failing now, because it checks the return types.

You need to change

FEATURE_TYPES = (PIL.Image.Image, torch.Tensor)

to (PIL.Image.Image, int). This indicates that the test should now expect an int opposed to a torch.Tensor as label type.

Copy link
Collaborator

@pmeier pmeier left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @avijit9! LGTM when CI is happy.

@codecov
Copy link

codecov bot commented Mar 19, 2021

Codecov Report

Merging #3587 (71d9b3e) into master (c00c4d3) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 71d9b3e differs from pull request most recent head c3df7f4. Consider uploading reports for the commit c3df7f4 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3587   +/-   ##
=======================================
  Coverage   79.07%   79.07%           
=======================================
  Files         105      105           
  Lines        9786     9786           
  Branches     1572     1572           
=======================================
  Hits         7738     7738           
  Misses       1567     1567           
  Partials      481      481           
Impacted Files Coverage Δ
torchvision/transforms/transforms.py 84.30% <ø> (ø)
torchvision/datasets/fakedata.py 92.59% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f0532d...c3df7f4. Read the comment docs.

@datumbox datumbox merged commit db1787f into pytorch:master Mar 20, 2021
facebook-github-bot pushed a commit that referenced this pull request Apr 1, 2021
)

Summary:
* added .item() for target inside getitem

* changed fakedataset's expected return type

Reviewed By: fmassa

Differential Revision: D27433929

fbshipit-source-id: 0e88193718a23f53249d35e71980c24cc3eaeafa

Co-authored-by: Vasilis Vryniotis <[email protected]>
@datumbox datumbox added bug and removed fix labels Apr 27, 2021
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.

5 participants