randint#

ray.tune.randint(lower: int, upper: int)[source]#

Sample an integer value uniformly between lower and upper.

lower is inclusive, upper is exclusive.

Sampling from tune.randint(0, 10) is equivalent to sampling from np.random.randint(0, 10)

Changed in version 1.5.0: When converting Ray Tune configs to searcher-specific search spaces, the lower and upper limits are adjusted to keep compatibility with the bounds stated in the docstring above.

Parameters:
  • lower (int) – Lower boundary of the output interval, inclusive.

  • upper (int) – Upper boundary of the output interval, exclusive.

Returns:

An Integer domain that samples uniformly between lower and upper.