From d89c89dbce4d6f6db810b6066d3ec36fe485b770 Mon Sep 17 00:00:00 2001 From: Jake VanderPlas Date: Tue, 17 Oct 2023 13:39:18 -0700 Subject: [PATCH] [LSC] change uses of jax.random.KeyArray and jax.random.PRNGKeyArray 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 (https://github.com/google/jax/pull/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: 574251334 --- dataset_grouper/examples/training/jax_fed_algs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataset_grouper/examples/training/jax_fed_algs.py b/dataset_grouper/examples/training/jax_fed_algs.py index da3fbff..da20f02 100644 --- a/dataset_grouper/examples/training/jax_fed_algs.py +++ b/dataset_grouper/examples/training/jax_fed_algs.py @@ -20,7 +20,7 @@ import jax.numpy as jnp import optax -PRNGKey = jax.random.KeyArray +PRNGKey = jax.Array Params = Any Loss = jnp.float32 ClientOptState = optax.OptState