-
Notifications
You must be signed in to change notification settings - Fork 272
chore: replace legacy jax.random.PRNGKey with modern jax.random.key
#2134
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
base: master
Are you sure you want to change the base?
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
fehiepsi
left a comment
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.
Awesome!!
|
The following test case is failing on I am unable to reproduce the following test cases on my local machine. Maybe they pass in the next CI. |
0b63438 to
14d3ee8
Compare
|
@fehiepsi, pickling failed again. Can you rerun the CI? |
|
Could you add a simple test in test_pickle to check if we can pickle a PRNGKey? if it happens on CI and is unrelated to numpyro, we can report the issue to jax devs. |
|
It seems the tests are failing consistently. How about using PRNGKey like before in this test? |
As per the official JAX docs,
jax.random.PRNGKeyis a legacy API and should be replaced withjax.random.keywherever possible 1. This PR replaces calls tojax.random.PRNGKeywithjax.random.key, accompanied by necessary documentation.I have replaced "PRNGKey" with "PRNG key" in the documentation to distinguish PRNG key as a concept from the function
jax.random.PRNGKey.Footnotes
See note in https://docs.jax.dev/en/latest/jax.random.html#prng-keys ↩