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

Integer sequence support for chex.assert_tree_shape{_prefix, _suffix} #275

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

hylkedonker
Copy link

Currently, the shape_prefix argument of chex.assert_tree_shape_prefix requires a tuple instead of a integer sequence, as detailed in #274.

This pull request addresses this point, adding support for arbitrary integer sequences, for the following two functions:

  • chex.assert_tree_shape_prefix
  • chex.assert_tree_shape_suffix

In addition, this pull request adds unit tests to verify this (using lists instead of tuples) for the functions:

  • chex.assert_tree_shape_prefix
  • chex.assert_tree_shape_suffix
  • chex.assert_shape

@google-cla
Copy link

google-cla bot commented May 30, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@stompchicken stompchicken left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! I have a suggestion that I think will make some of the tests easier to manage.

chex/_src/asserts_test.py Show resolved Hide resolved
Copy link
Collaborator

@stompchicken stompchicken left a comment

Choose a reason for hiding this comment

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

Thanks a lot for contributing to Chex. I gave approval to merge but also commented on a tiny spelling error.

chex/_src/asserts_test.py Outdated Show resolved Hide resolved
@stompchicken stompchicken merged commit 58b0353 into google-deepmind:master Jun 2, 2023
copybara-service bot pushed a commit that referenced this pull request Jun 26, 2023
PiperOrigin-RevId: 543394310
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