mlx.core.random.randint#
- randint(low: scalar | array, high: scalar | array, shape: Sequence[int] = [], dtype: Dtype | None = int32, key: array | None = None, stream: StreamOrDevice = None) array#
Generate random integers from the given interval.
The values are sampled with equal probability from the integers in half-open interval
[low, high). The lower and upper bound can be scalars or arrays and must be broadcastable toshape.Note
The samples are drawn from a
float32uniform and clamped to[low, high - 1], so not every integer in the range is reachable once the bounds or the width of the interval go beyond the2**24integer resolution offloat32.- Parameters:
- Returns:
The array of random integers.
- Return type: