Skip to content

Commit

Permalink
alias prng.threefry_2x32 in random and warn of move
Browse files Browse the repository at this point in the history
  • Loading branch information
froystig committed Aug 15, 2021
1 parent 840c502 commit 134a9da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jax/_src/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,3 +1437,13 @@ def _weibull_min(key, scale, concentration, shape, dtype):

# Inverse weibull CDF.
return jnp.power(-jnp.log1p(-random_uniform), 1.0/concentration) * scale


# TODO(frostig): remove these aliases

threefry2x32_p = prng.threefry2x32_p

def threefry_2x32(keypair, count):
warnings.warn('jax.random.threefry_2x32 has moved to jax.prng.threefry_2x32 '
'and will be removed from `random` module.', FutureWarning)
return prng.threefry_2x32(keypair, count)
2 changes: 2 additions & 0 deletions jax/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@
shuffle,
split,
t,
threefry_2x32,
threefry2x32_p,
truncated_normal,
uniform,
weibull_min,
Expand Down

0 comments on commit 134a9da

Please sign in to comment.