where(condition: ivy.NativeArray, x1: ivy.NativeArray, x2: ivy.NativeArray, f: Optional[ivy.Framework] = None) → ivy.NativeArray¶
Returns elements chosen from x or y depending on condition.
condition (bool array) – Where True, yield x1, otherwise yield x2.
x1 (array) – values from which to choose when condition is True.
x2 (array) – values from which to choose when condition is False.
f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.
An array with elements from x1 where condition is True, and elements from x2 elsewhere.