Skip to main content

ClikaRT::ops::masked_scatter

function

masked_scatter()

Tensor masked_scatter(
    Tensor x,
    Tensor mask,
    Tensor source
)

A copy of x with the leading count(mask) elements of src (read row-major) written at the positions where mask is true.

mask is Bool, broadcastable to x; src must supply at least count(mask) elements.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) when src is too short or mask is not Bool (code_name() carries the reason).

Returns: a new tensor shaped like x.

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