Skip to main content

ClikaRT::ops::randint

function

randint()

Tensor randint(
    int64_t low,
    int64_t high,
    ClikaRT::Span<const ScalarOrTensor> shape,
    DataType dtype = DataType::Int64,
    StreamOrDevice s = {}
)

Uniform random integers in the half-open range [low, high).

Parameters

  • low: inclusive lower bound.
  • high: EXCLUSIVE upper bound; must exceed low.
  • shape: the output shape.
  • dtype: output integer dtype; default Int64.
  • s: stream or device; default = the default device.

Returns: a shape-shaped integer tensor.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) when high <= low or the range does not fit dtype.

Declared in ClikaRT/compute/ops.h, line 4097