Skip to content

Commit

Permalink
[LSC] change uses of jax.random.KeyArray and jax.random.PRNGKeyArray …
Browse files Browse the repository at this point in the history
…to jax.Array

This change replaces uses of jax.random.KeyArray and jax.random.PRNGKeyArray in the context of type annotations with jax.Array, which is the correct annotation for JAX PRNG keys moving forward.

The purpose of this change is to remove references to KeyArray and PRNGKeyArray, which are deprecated (jax-ml/jax#17594) and will soon be removed from JAX. The design and thought process behind this is described in https://jax.readthedocs.io/en/latest/jep/9263-typed-keys.html.

Note that KeyArray and PRNGKeyArray have always been aliased to Any, so the new type annotation is far more specific than the old one.

PiperOrigin-RevId: 574424548
  • Loading branch information
Jake VanderPlas authored and Rax Developers committed Oct 18, 2023
1 parent 34825d3 commit 6766f7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/t5x/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def __init__(

def get_initial_variables(
self,
rng: jax.random.PRNGKeyArray,
rng: jax.Array,
input_shapes, # pytype: disable=signature-mismatch # overriding-parameter-count-checks
input_types,
):
Expand Down

0 comments on commit 6766f7f

Please sign in to comment.