mlx.core.take#
- mlx.core.take(a: array, /, indices: array, axis: Optional[int] = None, *, stream: Union[None, Stream, Device] = None) array#
Take elements along an axis.
The elements are taken from
indicesalong the specified axis. If the axis is not specified the array is treated as a flattened 1-D array prior to performing the take.As an example, if the
axis=1this is equivalent toa[:, indices, ...].