jax.experimental.pallas.tpu.stateful_uniform

jax.experimental.pallas.tpu.stateful_uniform#

jax.experimental.pallas.tpu.stateful_uniform(*args, **kwargs)[source]#

Sample uniform random values in [minval, maxval) with given shape/dtype.

Parameters:
  • shape – optional, a tuple of nonnegative integers representing the result shape. Default ().

  • dtype – optional, a float dtype for the returned values (default float64 if jax_enable_x64 is true, otherwise float32).

  • minval – optional, a minimum (inclusive) value broadcast-compatible with shape for the range (default 0).

  • maxval – optional, a maximum (exclusive) value broadcast-compatible with shape for the range (default 1).

  • out_sharding – Optional. Specifies how the output array should be sharded across devices in multi-device computation. Can be a NamedSharding, a PartitionSpec (P), or None (default). When specified, the output will be sharded according to the given sharding specification. Primarily used in explicit sharding mode. See the explicit sharding tutorial for more details.

Returns:

A random array with the specified shape and dtype.