jax.random.randint
Warning
This page was created from a pull request (#9655).
jax.random.randintΒΆ
- jax.random.randint(key, shape, minval, maxval, dtype=<class 'numpy.int64'>)[source]ΒΆ
Sample uniform random values in [minval, maxval) with given shape/dtype.
- Parameters
key (
Union
[Any
,PRNGKeyArray
]) β a PRNG key used as the random key.shape (
Sequence
[int
]) β a tuple of nonnegative integers representing the shape.minval (
Any
) β int or array of ints broadcast-compatible withshape
, a minimum (inclusive) value for the range.maxval (
Any
) β int or array of ints broadcast-compatible withshape
, a maximum (exclusive) value for the range.dtype (
Any
) β optional, an int dtype for the returned values (default int64 if jax_enable_x64 is true, otherwise int32).
- Returns
A random array with the specified shape and dtype.