dpnp.random.normal¶
- dpnp.random.normal(loc=0.0, scale=1.0, size=None, device=None, usm_type='device', sycl_queue=None)[source]¶
Draw random samples from a normal (Gaussian) distribution.
For full documentation refer to
numpy.random.normal.- Parameters:
- 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.- usm_type{"device", "shared", "host"}, optional
The type of SYCL USM allocation for the output array.
Default:
"device".- 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.
- Returns:
- outdpnp.ndarray
Drawn samples from the parameterized normal distribution. Output array data type is the same as input dtype. If dtype is
None(the default),dpnp.float64type will be used if device supports it, ordpnp.float32otherwise.
Limitations
Parameters loc and scale are supported as scalar. Otherwise,
numpy.random.normal(loc, scale, size)samples are drawn. Parameter dtype is supported only asdpnp.float32,dpnp.float64orNone.Examples
Draw samples from the distribution:
>>> mu, sigma = 0, 0.1 # mean and standard deviation >>> s = dpnp.random.normal(mu, sigma, 1000)