randint

ivy.randint(low, high, shape, dev_str='cpu', f=None)[source]

Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive).

Parameters
  • low (int) – Lowest integer to be drawn from the distribution.

  • high (int) – One above the highest integer to be drawn from the distribution.

  • shape (tuple) – a tuple defining the shape of the output tensor.

  • dev_str (str) – device on which to create the array ‘cuda:0’, ‘cuda:1’, ‘cpu’ etc.

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.

Returns


Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty