-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Update RandomSampler docstring. data_source must be Sized not Dataset #158857
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
base: main
Are you sure you want to change the base?
Update RandomSampler docstring. data_source must be Sized not Dataset #158857
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/158857
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New Failures, 4 Unrelated FailuresAs of commit 911c8b2 with merge base 7a08755 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label "topic: not user facing" |
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.
Can we also updated the docstring for Sampler
class, and SequentialSampler
class ?
Hi @divyanshk I updated the docstring in SequentialSampler to use Sized instead of Dataset since it calls len(data_sourcee) like RandomSampler. But I left Sampler as is because its data_source argument is unused and marked for removal in 2.2.0. Changing the type there didn't seem necessary to me but please let me know if you'd prefer I update that one too. |
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.
Looks good to me! Thank you!
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 2 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
Hi @dsashidh can you resolve the CI errors ? Thanks. |
Hi @divyanshk The CI failures appear to be permission-related issues rather than code issues: Could you please re-trigger the CI run when you get a chance? Thanks! |
Fixes #158631
The docstring said data_source was a Dataset, but RandomSampler only needs something that implements len. This updates the docstring to use Sized instead, which matches the actual type used in the constructor.