Warning
This page was created from a pull request.
jax.random.uniformΒΆ
-
jax.random.
uniform
(key, shape=(), dtype=<class 'numpy.float64'>, minval=0.0, maxval=1.0)[source]ΒΆ Sample uniform random values in [minval, maxval) with given shape/dtype.
- Parameters
key (
ndarray
) β a PRNGKey used as the random key.shape (
Sequence
[int
]) β optional, a tuple of nonnegative integers representing the result shape. Default ().dtype (
dtype
) β optional, a float dtype for the returned values (default float64 if jax_enable_x64 is true, otherwise float32).minval (
Union
[float
,ndarray
]) β optional, a minimum (inclusive) value broadcast-compatible with shape for the range (default 0).maxval (
Union
[float
,ndarray
]) β optional, a maximum (exclusive) value broadcast-compatible with shape for the range (default 1).
- Return type
ndarray
- Returns
A random array with the specified shape and dtype.