Skip to main content

ClikaRT::ops::masked_select

function

masked_select()

Tensor masked_select(Tensor x, Tensor mask)

The elements of x where mask is true, as a 1-D tensor.

The output LENGTH is data-dependent (the number of true entries); under tracing it carries a data-dependent extent. mask is Bool and broadcasts to x's shape.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) when mask is not Bool or does not broadcast to x (code_name() carries the reason).

Returns: a new 1-D tensor of the selected elements, dtype of x.

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