dpnp.tensor.extract

dpnp.tensor.extract(condition, arr)[source]

Returns the elements of an array that satisfies the condition.

If condition is boolean dpnp.tensor.extract is equivalent to arr[condition].

Note that dpnp.tensor.place does the opposite of dpnp.tensor.extract.

Parameters:
  • condition (usm_ndarray) -- An array whose non-zero or True entries indicate the element of arr to extract.

  • arr (usm_ndarray) -- Input array of the same size as condition.

Returns:

out -- Rank 1 array of values from arr where condition is True.

Return type:

usm_ndarray