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}, 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. 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:

out -- Drawn samples from the parameterized normal distribution. Output array data type is the same as input dtype. If dtype is None (the default), dpnp.float64 type will be used if device supports it, or dpnp.float32 otherwise.

Return type:

dpnp.ndarray

Limitations

Parameters loc and scale are supported as scalar. Otherwise, numpy.random.normal(loc, scale, size) samples are drawn. Parameter dtype is supported only as dpnp.float32, dpnp.float64 or None.

Examples

Draw samples from the distribution:

>>> mu, sigma = 0, 0.1 # mean and standard deviation
>>> s = dpnp.random.normal(mu, sigma, 1000)