dpctl.tensor.place¶
- dpctl.tensor.place(arr, mask, vals)[source]¶
Change elements of an array based on conditional and input values.
If
maskis booleandpctl.tensor.placeis 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. Ifvalsis smaller than N, it will be repeated, and if elements ofarrare to be masked, this sequence must be non-empty. Arrayvalsmust be one dimensional.