cupy.where¶
-
cupy.
where
= <function where>¶ Return elements, either from x or y, depending on condition.
If only condition is given, return
condition.nonzero()
.Parameters: - condition (cupy.ndarray) – When True, take x, otherwise take y.
- x (cupy.ndarray) – Values from which to choose on
True
. - y (cupy.ndarray) – Values from which to choose on
False
.
Returns: - Each element of output contains elements of
x
when condition
isTrue
, otherwise elements ofy
. If onlycondition
is given, return the tuplecondition.nonzero()
, the indices wherecondition
is True.
Return type: See also