cupy.take

cupy.take(a, indices, axis=None, out=None)[source]

Takes elements of an array at specified indices along an axis.

This is an implementation of “fancy indexing” at single axis.

This function does not support mode option.

Parameters:
  • a (cupy.ndarray) – Array to extract elements.
  • indices (int or array-like) – Indices of elements that this function takes.
  • axis (int) – The axis along which to select indices. The flattened input is used by default.
  • out (cupy.ndarray) – Output array. If provided, it should be of appropriate shape and dtype.
Returns:

The result of fancy indexing.

Return type:

cupy.ndarray

See also

numpy.take()