Element-wise selection based on a boolean predicate, like R's ifelse().
For each element, returns the corresponding element from true_value where
pred is TRUE and from false_value where pred is FALSE.
Arguments
- pred
(
arrayish)
Predicate array. Must be a boolean or an R logical, and scalar or the same shape astrue_value.- true_value, false_value
(
arrayish)
Values to select from, of the same shape. Can be any data type.true_valueandfalse_valuemust have the same data type. An R value among them assumes the data type of the others when it is in its data type category, and its default data type when none of them has one.
Value
(arrayish)
Has the shape of true_value and false_value, and the data type they
agreed on.
StableHLO
Lowers to hlo_select(), specified under
select.