dpnp.random.Generator.standard_cauchy

method

Generator.standard_cauchy(size=None, dtype=None, *, usm_type=None)[source]

Draw samples from a standard Cauchy distribution with mode = 0.

For full documentation refer to numpy.random.Generator.standard_cauchy.

Parameters:
size{None, int, tuple of ints}, optional

Output shape. With None, a zero-dimensional array is returned.

Default: None.

dtype{None, dtype}, optional

The data type of the output, dpnp.float32 or dpnp.float64.

Default: None, which means the default floating-point type of the device.

usm_type{None, "device", "shared", "host"}, optional

The type of SYCL USM allocation for the output array.

Default: None, which means "device".

Returns:
outdpnp.ndarray

The samples.

Limitations

dtype and usm_type are not in NumPy's signature.

Examples

>>> import dpnp as np
>>> rng = np.random.default_rng(42)
>>> x = rng.standard_cauchy(10**5)
>>> bool(abs(np.median(x)) < 0.05)
True