mindspore.ops.randint
- mindspore.ops.randint(low, high, size, seed=None, *, dtype=None)[source]
Return a tensor whose elements are random integers in the range of [ low , high ) .
Warning
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect.
- Parameters
- Keyword Arguments
dtype (
mindspore.dtype
, optional) – The data type returned. DefaultNone
.- Returns
Tensor
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> print(mindspore.ops.randint(1, 10, (2,3))) [[4 9 7] [9 1 2]]