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 f32a08b commit 36479bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jax/_src/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,3 +1437,9 @@ def _weibull_min(key, scale, concentration, shape, dtype):

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


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)
1 change: 1 addition & 0 deletions jax/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
shuffle,
split,
t,
threefry_2x32,
truncated_normal,
uniform,
weibull_min,
Expand Down

0 comments on commit 36479bd

Please sign in to comment.