Conditional execution of two branches.
Unlike nv_ifelse(), which selects elements, this executes only one
of the two branches depending on a scalar predicate.
Arguments
- pred
(
arrayishof boolean type, scalar)
Predicate.- true
(
function())
Zero-argument function for the true branch.- false
(
function())
Zero-argument function for the false branch. Must return outputs with the same shapes as the true branch.
See also
prim_if() for the underlying primitive, nv_ifelse() for
element-wise selection.