dpctl.tensor.place¶
- dpctl.tensor.place(arr, mask, vals)[source]¶
Change elements of an array based on conditional and input values.
If
mask
is booleandpctl.tensor.place
is equivalent toarr[condition] = vals
.- Parameters:
arr (usm_ndarray) – Array to put data into.
mask (usm_ndarray) – Boolean mask array. Must have the same size as
arr
.vals (usm_ndarray, sequence) – Values to put into
arr
. Only the first N elements are used, where N is the number of True values inmask
. Ifvals
is smaller than N, it will be repeated, and if elements ofarr
are to be masked, this sequence must be non-empty. Arrayvals
must be one dimensional.