Mojo function
select
select(condition: Symbol, x: Symbol, y: Symbol, location: Optional[_SourceLocation] = #kgen.none) -> Symbol
Returns condition ? x : y
(element-wise), where cond
, x
and y
are input tensors.
Args:
- βcondition (
Symbol
): The condition tensor to use for selecting elementwise values. - βx (
Symbol
): If the condition is true at a position, the value from the same position in this tensor will be selected. - βy (
Symbol
): If the condition is false at a position, the value from the same position in this tensor will be selected. - βlocation (
Optional[_SourceLocation]
): An optional location for a more specific error message.
Returns:
A new symbolic tensor holding either values from either x
or y
, based on the elements in condition
.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
π What went wrong?