cupy.random.multinomial#

cupy.random.multinomial(n, pvals, size=None)[source]#

Returns an array from multinomial distribution.

Parameters:
  • n (int) – Number of trials.

  • pvals (cupy.ndarray) – Probabilities of each of the p different outcomes. The sum of these values must be 1.

  • size (int or tuple of ints or None) – Shape of a sample in each trial. For example when size is (a, b), shape of returned value is (a, b, p) where p is len(pvals). If size is None, it is treated as (). So, shape of returned value is (p,).

Returns:

An array drawn from multinomial distribution.

Return type:

cupy.ndarray

Note

It does not support sum(pvals) < 1 case.

See also

numpy.random.multinomial()