Skip to content
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

Adding GroupBatcher DataPipe #876

Open
wants to merge 2 commits into
base: gh/VitalyFedyunin/28/base
Choose a base branch
from

Conversation

VitalyFedyunin
Copy link
Contributor

@VitalyFedyunin VitalyFedyunin commented Nov 3, 2022

        dp = IterableWrapper(range(20))
        dp = dp.group_batch(batch_size=2, number_of_groups=5, group_key_fn=lambda x: x % 5)
        actual = list(dp)
        expected = [[0, 5], [1, 6], [2, 7], [3, 8], [4, 9], [10, 15], [11, 16], [12, 17], [13, 18], [14, 19]]
        self.assertEqual(expected, actual)

Stack from ghstack (oldest at bottom):

VitalyFedyunin added a commit that referenced this pull request Nov 3, 2022
ghstack-source-id: cde55af957fbeef0ce51746dfed556b465da72c7
Pull Request resolved: #876
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 3, 2022
```python

        dp = IterableWrapper(range(20))
        dp = dp.bucket_batch(batch_size=2, number_of_buckets=5, bucket_function=lambda x: x % 5)
        actual = list(dp)
        expected = [[0, 5], [1, 6], [2, 7], [3, 8], [4, 9], [10, 15], [11, 16], [12, 17], [13, 18], [14, 19]]
        self.assertEqual(expected, actual)

```




[ghstack-poisoned]
VitalyFedyunin added a commit that referenced this pull request Nov 3, 2022
ghstack-source-id: 166b175d6151084b06fb6bdd8e8088910b61a559
Pull Request resolved: #876
@VitalyFedyunin VitalyFedyunin changed the title [WIP] Bucket Batch DataPipe (rename after discussion) Adding GroupBatcher DataPipe Nov 3, 2022
@facebook-github-bot
Copy link
Contributor

Hi @VitalyFedyunin!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants