ClikaRT::ops::masked_fill
function
masked_fill()
Tensor masked_fill(
Tensor input,
Tensor mask,
ScalarOrTensor value
)
Replace the elements of input where mask is true with value.
mask is Bool and broadcasts to input's shape; value is a literal or a 0-D Tensor.
Throws
ClikaRT::Error: (INVALID_ARGUMENT) whenmaskis not Bool or does not broadcast toinput(code_name()carries the reason).
Returns: a new tensor shaped like input.
auto masked = ClikaRT::ops::masked_fill(scores, pad_mask, -1e9);
Declared in ClikaRT/compute/ops.h, line 2517