cupy.random.uniform#

cupy.random.uniform(low=0.0, high=1.0, size=None, dtype=<class 'float'>)[source]#

Returns an array of uniformly-distributed samples over an interval.

Samples are drawn from a uniform distribution over the half-open interval [low, high). The samples may contain the high limit due to floating-point rounding.

Parameters:
  • low (float) – Lower end of the interval.

  • high (float) – Upper end of the interval.

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

  • dtype – Data type specifier.

Returns:

Samples drawn from the uniform distribution.

Return type:

cupy.ndarray