Skip to main content

ClikaRT::ops::index_fill

function

index_fill()

Tensor index_fill(
    Tensor x,
    int64_t dim,
    Tensor indices,
    ScalarOrTensor value
)

A copy of x with the rows at indices along dim set to value: out[.., indices[i], ..] = value.

indices is 1-D Int32/Int64; value is a literal or a 0-D Tensor.

Throws

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

Returns: a new tensor shaped like x.

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