Skip to main content

ClikaRT::ops::take

function

take()

Tensor take(Tensor self, Tensor index)

Read elements of self at FLAT (row-major linearized) positions.

self is treated as flattened 1-D: out[..] = self.flat[index[..]]. The output takes index's shape and self's dtype. Index dtype law as gather.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) when an index is out of range or its dtype is wrong (code_name() carries the reason).

Returns: a new tensor shaped like index, dtype of self.

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