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

Add size based assertions #265

Merged
merged 2 commits into from
Apr 24, 2023
Merged

Add size based assertions #265

merged 2 commits into from
Apr 24, 2023

Conversation

tttc3
Copy link
Contributor

@tttc3 tttc3 commented Apr 20, 2023

Adds size based assertions: assert_size, assert_equal_size, assert_trees_all_equal_sizes. The additions are based on the shape based equivalents.

These assertions are useful for one of my own use cases, so thought they might be a nice addition to the package.

Copy link
Collaborator

@hbq1 hbq1 left a comment

Choose a reason for hiding this comment

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

This is awesome! Thanks a lot for the PR!

@@ -58,6 +60,7 @@
from chex._src.asserts import assert_trees_all_equal
from chex._src.asserts import assert_trees_all_equal_comparator
from chex._src.asserts import assert_trees_all_equal_dtypes
from chex._src.asserts import assert_trees_all_equal_sizes
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing this one in __all__.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot, this is sorted in the latest commit.

Copy link
Collaborator

@hbq1 hbq1 left a comment

Choose a reason for hiding this comment

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

Thanks!

@copybara-service copybara-service bot merged commit 9a7b5ef into google-deepmind:master Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants