dpnp.random.RandomState¶
- class dpnp.random.RandomState(seed=None, device=None, sycl_queue=None)[source]¶
A container of a pseudo-random number generator on a SYCL device, with the legacy API of NumPy.
For full documentation refer to
numpy.random.RandomState.- Parameters:
- seed{None, int, array_like[ints], BitGenerator}, optional
A random seed to initialize the pseudo-random number generator, as for
numpy.random.RandomState: an integer in [0, 2**32 - 1] or a 1-D array of such integers. WithNone, fresh entropy is pulled from the operating system. Adpnp.random.BitGeneratoris used as the bit generator, on its own queue.Default:
None.- device{None, string, SyclDevice, SyclQueue, Device}, optional
An array API concept of device where the output array is created. device can be
None, a oneAPI filter selector string, an instance ofdpctl.SyclDevicecorresponding to a non-partitioned SYCL device, an instance ofdpctl.SyclQueue, or adpnp.tensor.Deviceobject returned bydpnp.ndarray.device.Default:
None.- sycl_queue{None, SyclQueue}, optional
A SYCL queue to use for output array allocation and copying. The sycl_queue can be passed as
None(the default), which means to get the SYCL queue from device keyword if present or to use a default queue.Default:
None.
Limitations
Unless seed is a
dpnp.random.BitGenerator, the bit generator isdpnp.random.Philox4x3210rather than MT19937, so the values drawn differ from NumPy's, and the state is that ofdpnp.random.Philox4x3210. device and sycl_queue cannot be given with adpnp.random.BitGenerator. The values for a seed are those ofdpnp.random.default_rng(seed)for the distributions whose checks agree, and depend on the device as described in the differences from NumPy.Every method returns a
dpnp.ndarray, zero-dimensional when size isNoneand the parameters are scalars, rather than a Python scalar. The floating-point methods take a dtype, which defaults to the default floating-point type of the device, and every method a usm_type, the type of USM allocation of the output, which by default is that of the array parameters, or"device". Parameters that are on the device are checked as NumPy checks all parameters, so a call with such parameters waits for the device, unlike the methods ofdpnp.random.Generator.