dpnp.random.RandomState.randn

method

RandomState.randn(*args, usm_type='device')[source]

Return a sample (or samples) from the "standard normal" distribution.

For full documentation refer to numpy.random.RandomState.randn.

Parameters:

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

Returns:

out -- A (d0, d1, ..., dn)-shaped array of floating-point samples from the standard normal distribution, or a single such float if no parameters were supplied. Output array data type is dpnp.float64 if device supports it, or dpnp.float32 otherwise.

Return type:

dpnp.ndarray

Examples

>>> s = dpnp.random.RandomState().randn()
>>> print(s)
-0.84401099

Two-by-four array of samples from the normal distribution with mean 3 and standard deviation 2.5:

>>> s = dpnp.random.RandomState().randn(2, 4)
>>> print(s)
[[ 0.88997253 -1.54288406  1.63836967  3.46394577]
 [ 3.70882036  4.69295758  5.78927254  6.04921661]]