flopscope.

flopscope.numpy.random.standard_exponential

fnp.random.standard_exponential(size=None)[flopscope source]

Draw samples from the standard exponential distribution.

Adapted from NumPy docs np.random.standard_exponential

Arearandom
Typecustom
Cost
16×per-operation
Flopscope Context

Sampling; cost = numel(output).

standard_exponential is identical to the exponential distribution with a scale parameter of 1.

Note.

New code should use the standard_exponential method of a Generator instance instead; please see the random-quick-start.

Parameters

size:int or tuple of ints, optional

Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned.

Returns

out:float or ndarray

Drawn samples.

See also

Examples

Output a 3x8000 array:

>>> n = flops.random.standard_exponential((3, 8000))