dpnp.random.random

dpnp.random.random(size=None, device=None, usm_type='device', sycl_queue=None)[source]

Return random floats in the half-open interval [0.0, 1.0).

Alias for random_sample.

For full documentation refer to numpy.random.random.

Parameters:
  • device ({None, string, SyclDevice, SyclQueue}, optional) -- An array API concept of device where the output array is created. The device can be None (the default), an OneAPI filter selector string, an instance of dpctl.SyclDevice corresponding to a non-partitioned SYCL device, an instance of dpctl.SyclQueue, or a Device object returned by dpnp.dpnp_array.dpnp_array.device property.

  • usm_type ({"device", "shared", "host"}, optional) -- The type of SYCL USM allocation for the output array.

  • sycl_queue ({None, SyclQueue}, optional) -- A SYCL queue to use for output array allocation and copying.

Returns:

out -- Array of random floats of shape size (if size=None, zero dimension array with a single float is returned). Output array data type is dpnp.float64 if device supports it, or dpnp.float32 otherwise.

Return type:

dpnp.ndarray

Examples

>>> s = dpnp.random.random(1000)