dpnp.tensor.take¶
- dpnp.tensor.take(x, indices, /, *, axis=None, out=None, mode='wrap')[source]¶
Takes elements from an array along a given axis at given indices.
- Parameters:
x (usm_ndarray) -- The array that elements will be taken from.
indices (usm_ndarray) -- One-dimensional array of indices.
axis ({None, int}, optional) --
The axis along which the values will be selected. If
xis one-dimensional, this argument is optional.Default:
None.out ({None, usm_ndarray}, optional) --
Output array to populate. Array must have the correct shape and the expected data type.
Default:
None.mode ({"wrap", "clip"}, optional) --
How out-of-bounds indices will be handled. Possible values are:
"wrap": clamps indices to (-n <= i < n), then wraps negative indices."clip": clips indices to (0 <= i < n).
Default:
"wrap".
- Returns:
out -- Array with shape
x.shape[:axis] + indices.shape + x.shape[axis + 1:]filled with elements fromx.- Return type: