cupy.random.sample

cupy.random.sample(size=None, dtype=<class 'float'>)[source]

Returns an array of random values over the interval [0, 1).

This is a variant of cupy.random.rand().

Parameters:
  • size (int or tuple of ints) – The shape of the array.
  • dtype – Data type specifier. Only numpy.float32 and numpy.float64 types are allowed.
Returns:

An array of uniformly distributed random values.

Return type:

cupy.ndarray

See also

numpy.random.random_sample()