Skip to main content

ClikaRT::ops::masked_scatter

function

masked_scatter()​

Tensor masked_scatter(
    Tensor input,
    Tensor mask,
    Tensor source
)

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

mask is Bool, broadcastable to input; 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 input.

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