-
Notifications
You must be signed in to change notification settings - Fork 247
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
Update jax.tree_util.tree_map to jax.tree.map #1821
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm although i might have chosen to keep explicit min
and max
@@ -1417,7 +1415,7 @@ def _inverse(self, y: jnp.ndarray) -> jnp.ndarray: | |||
return y | |||
|
|||
def extend_axis_rev(self, array: jnp.ndarray, axis: int) -> jnp.ndarray: | |||
normalized_axis = normalize_axis_tuple(axis, array.ndim)[0] | |||
normalized_axis = axis if axis >= 0 else jnp.ndim(array) + axis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This raises a warning that this function is hidden and accessing it through numpy.core.numeric is deprecated.
The current numpy versions still use a_min a_max. They have a PR to deprecate those arguments but it has not been merged yet. |
Since jax 0.4.25 (released Feb 24),
jax.tree_util.tree_map
is deprecated, in favor ofjax.tree.map
. This PR updates numpyro to use the new pattern.In addition,
jnp.clip(..., a_min=..., a_max=...)
is deprecated. I change the pattern tojnp.clip(..., ..., ...)
to remove the deprecation warning in the tests.