fix RandomSampler length#15991
Closed
truskovskiyk wants to merge 3 commits into
Closed
Conversation
Closed
jbaron
approved these changes
Jan 12, 2019
jbaron
left a comment
There was a problem hiding this comment.
The correct patch as discussed in the issue: the dataset now returns the correct length in case num_samples is specified. Also good that there are now some tests in place which prevent a regression issue to popup in the future. Thanks!
apaszke
reviewed
Jan 13, 2019
|
|
||
| @property | ||
| def num_samples(self): | ||
| # work round around growing dataset |
Contributor
There was a problem hiding this comment.
It would be clearer to say that “dataset size might change at runtime”
Contributor
Author
There was a problem hiding this comment.
@apaszke thanks for a great advice. Fixed.
Contributor
Author
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
@soumith is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
pushed a commit
that referenced
this pull request
Jan 14, 2019
Summary: Hi! This PR addresses #15537 issue. Please review. Thanks! Differential Revision: D13649890 Pulled By: soumith fbshipit-source-id: 166212ae383331345423236dfc4fa2ea907d265d
Member
|
Merged in a741578 |
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
Summary: Hi! This PR addresses pytorch#15537 issue. Please review. Thanks! Differential Revision: D13649890 Pulled By: soumith fbshipit-source-id: 166212ae383331345423236dfc4fa2ea907d265d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
This PR addresses #15537 issue.
Please review.
Thanks!
cc: @fmassa @jbaron @soumith