# cupy.random.gamma¶

cupy.random.gamma(shape, scale=1.0, size=None, dtype=<class 'float'>)[source]

Gamma distribution.

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

$f(x) = \frac{1}{\Gamma(k)\theta^k}x^{k-1}e^{-x/\theta}.$
Parameters: shape (array) – Parameter of the gamma distribution $$k$$. scale (array) – Parameter of the gamma distribution $$\theta$$ 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.float32 and numpy.float64 types are allowed.

Returns:cupy.ndarray: Samples drawn from the gamma distribution.