Skip to main content

ClikaRT::ops::randperm

function

randperm()

Tensor randperm(
    ScalarOrTensor n,
    DataType dtype = DataType::Int64,
    StreamOrDevice s = {}
)

A random permutation of the integers 0 .. n-1.

Parameters

  • n: the permutation length (scalar or 0-D tensor).
  • dtype: output integer dtype; default Int64.
  • s: stream or device; default = the default device.

Returns: a 1-D tensor of length n holding each index exactly once.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) on a negative n.

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