jax.random.randint#
- jax.random.randint(key, shape, minval, maxval, dtype=<class 'int'>)[source]#
Sample uniform random values in [minval, maxval) with given shape/dtype.
- Parameters:
key (
Union[Array,ndarray,bool_,number,bool,int,float,complex]) – a PRNG key used as the random key.shape (
Sequence[int]) – a tuple of nonnegative integers representing the shape.minval (
Union[Array,ndarray,bool_,number,bool,int,float,complex]) – int or array of ints broadcast-compatible withshape, a minimum (inclusive) value for the range.maxval (
Union[Array,ndarray,bool_,number,bool,int,float,complex]) – int or array of ints broadcast-compatible withshape, a maximum (exclusive) value for the range.dtype (
Union[str,type[Any],dtype,SupportsDType]) – optional, an int dtype for the returned values (default int64 if jax_enable_x64 is true, otherwise int32).
- Return type:
- Returns:
A random array with the specified shape and dtype.