cupy.random.geometric

cupy.random.geometric(p, size=None, dtype=<class 'int'>)[source]

Geometric distribution.

Returns an array of samples drawn from the geometric distribution. Its probability mass function is defined as

\[f(x) = p(1-p)^{k-1}.\]
Parameters
  • p (float) – Success probability of the geometric distribution.

  • size (int or tuple of ints) – The shape of the array. If None, a zero-dimensional array is generated.

  • dtype – Data type specifier. Only numpy.int32 and numpy.int64 types are allowed.

Returns

Samples drawn from the geometric distribution.

Return type

cupy.ndarray

See also

cupy.random.RandomState.geometric() numpy.random.geometric