dpctl.tensor.extract¶
- dpctl.tensor.extract(condition, arr)[source]¶
Returns the elements of an array that satisfies the condition.
If
condition
is booleandpctl.tensor.extract
is equivalent toarr[condition]
.Note that
dpctl.tensor.place
does the opposite ofdpctl.tensor.extract
.- Parameters:
conditions (usm_ndarray) – An array whose non-zero or
True
entries indicate the element ofarr
to extract.arr (usm_ndarray) – Input array of the same size as
condition
.
- Returns:
Rank 1 array of values from
arr
wherecondition
isTrue
.- Return type: