-
Notifications
You must be signed in to change notification settings - Fork 2.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
Add repeat method to datasets #7198
base: main
Are you sure you want to change the base?
Conversation
@lhoestq does this look reasonable? |
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.
Great ! It looks good overall, I added minor suggestions :)
Feel free to add a test for the map-style and iterable case and we can merge imo
updated and added test cases! |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Following up on discussion in #6623 and #7198 I thought this would be pretty useful for my case so had a go at implementing.
My main motivation is to be able to call iterable_dataset.repeat(None).take(samples_per_epoch) to safely avoid timeout issues in a distributed training setting. This would provide a straightforward workaround for several open issues related to this situation: #6437, #6594, #6623, #6719.
@lhoestq let me know if this looks on the right track!