chainerx.where

chainerx.where(condition, x, y)

Return elements chosen from x or y depending on condition.

Parameters
  • condition (ndarray) – Where True, yield x, otherwise

  • y. (yield) –

  • x (ndarray) – Values from which to choose.

  • y (ndarray) – Values from which to choose.

Returns

An array with elements from x where condition is True, and elements from y elsewhere.

Return type

ndarray()

Note

During backpropagation, this function propagates the gradient of the output array to the input array x and y.

See also

numpy.where()