cunumeric.random.randint#

cunumeric.random.randint(low: int, high: Union[int, None] = None, size: Union[NdShapeLike, None] = None, dtype: Union[np.dtype[Any], type, None] = <class 'int'>) int | ndarray | npt.NDArray[Any]#

Return random integers from low (inclusive) to high (exclusive).

Parameters:
  • low (int or array_like[int]) – Lowest (signed) integers to be drawn from the distribution (unless high=None, in which case this parameter is one above the highest such integer).

  • high (int or array_like[int], optional) – If provided, one above the largest (signed) integer to be drawn from the distribution (see above for behavior if high=None). If array-like, must contain integer values

  • size (int or tuple[int], optional) – Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned.

  • dtype (data-type, optional) – Desired dtype of the result. Byteorder must be native. The default value is int.

Returns:

outsize-shaped array of random integers from the appropriate distribution, or a single such random int if size not provided.

Return type:

int or ndarray[int]

Availability:

Multiple GPUs, Multiple CPUs