Skip to main content

//clika-runtime/io.clika.runtime/Ops/where

where

[common]
fun where(condition: Tensor, input: Tensor, other: Tensor): Tensor

where(condition: Tensor, input: Tensor, other: Tensor): the where operator. Elementwise select: condition ? x : y, with numpy-style broadcasting across all three operands. condition is Bool; the output takes the broadcast shape and the promoted common dtype of input and other.

[common]
fun where(condition: Tensor): Tensor

where(condition: Tensor): the where operator. The coordinates where condition is nonzero, sugar for nonzero. Returns the same [n, ndim] Int64 coordinate matrix as ONE tensor (not a per-dim tuple); the row count is data-dependent.