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

Fix computation with splited blocks #1434

Merged
merged 5 commits into from
Apr 29, 2022
Merged

Fix computation with splited blocks #1434

merged 5 commits into from
Apr 29, 2022

Conversation

jrapin
Copy link
Contributor

@jrapin jrapin commented Apr 22, 2022

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Motivation and Context / Related issue

How Has This Been Tested (if it applies)

Checklist

  • The documentation is up-to-date with the changes I made.
  • I have read the CONTRIBUTING document and completed the CLA (see CLA).
  • All tests passed, and additional code has been covered with new tests.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Apr 22, 2022
@jrapin
Copy link
Contributor Author

jrapin commented Apr 22, 2022

Replaces #1432

@@ -52,6 +52,7 @@ def _initialize(self) -> None:
self._dimension, self.block_dimension * self.num_blocks, replace=False
).tolist()
indices.sort() # keep the indices sorted sorted so that blocks do not overlap
# Caution this is also important for split, so that splitted arrays end un in the same block
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Caution this is also important for split, so that splitted arrays end un in the same block
# Caution this is also important for split, so that splitted arrays end up in the same block

data = self._transform(recommendations[0].args[0])
assert not recommendations[0].kwargs
# we can concatenate since blocks are necessarily sorted
data = np.concatenate(recommendations[0].args, axis=0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aaaaaaah c'etait ca. Ok My bad I was testing "flatten" and desperately failing.

@teytaud teytaud merged commit 5237e19 into main Apr 29, 2022
@teytaud teytaud deleted the split_blocks branch April 29, 2022 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants