Feat: Support dynamic batch size in BatchSamplerShard with even_batches#3969
Feat: Support dynamic batch size in BatchSamplerShard with even_batches#3969yuxinyuan wants to merge 2 commits into
Conversation
|
@SunMarc Can you take a look |
|
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
|
Anyone has time to look at this ? |
|
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
SunMarc
left a comment
There was a problem hiding this comment.
Thanks ! I'm just curious when you happened to need this
|
Usually The |
What does this PR do?
BatchSamplerShard previously forces uneven batches (even_batches=False) for dynamic batch sizes (e.g. batch_size is None). This PR extends it to work correctly with samplers that yield variable-length batches (i.e., batch_size=None), while preserving all existing behavior.
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.