You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Conceptually, ``take(x, indices, axis=3)`` is equivalent to ``x[:,:,:,indices,...]``; however, explicit indexing via arrays of indices is not currently supported in this specification due to concerns regarding ``__setitem__`` and array mutation semantics.
12
-
13
10
Parameters
14
11
----------
15
12
x: array
16
13
input array. Should have one or more dimensions (axes).
17
14
indices: array
18
-
array indices. The array must be one-dimensional and have an integer data type.
19
-
20
-
.. note::
21
-
This specification does not require bounds checking. The behavior for out-of-bounds indices is left unspecified.
22
-
15
+
array indices. The array must be one-dimensional and have an integer data type. If an index is negative, the function must determine the element to select along a specified axis (dimension) by counting from the last element (where ``-1`` refers to the last element).
23
16
axis: Optional[int]
24
-
axis over which to select values. If ``axis`` is negative, the function must determine the axis along which to select values by counting from the last dimension.
17
+
axis over which to select values. If ``axis`` is negative, the function must determine the axis along which to select values by counting from the last dimension (where ``-1`` refers to the last dimension).
25
18
26
19
If ``x`` is a one-dimensional array, providing an ``axis`` is optional; however, if ``x`` has more than one dimension, providing an ``axis`` is required.
- Conceptually, ``take(x, indices, axis=3)`` is equivalent to ``x[:,:,:,indices,...]``; however, explicit indexing via arrays of indices is not currently supported in this specification due to concerns regarding ``__setitem__`` and array mutation semantics.
30
+
- This specification does not require bounds checking. The behavior for out-of-bounds indices is left unspecified.
36
31
- When ``x`` is a zero-dimensional array, behavior is unspecified and thus implementation-defined.
input array. Must be compatible with ``indices``, except for the axis (dimension) specified by ``axis`` (see :ref:`broadcasting`).
53
48
indices: array
54
-
array indices. Must have the same rank (i.e., number of dimensions) as ``x``.
55
-
56
-
.. note::
57
-
This specification does not require bounds checking. The behavior for out-of-bounds indices is left unspecified.
58
-
49
+
array indices. Must have the same rank (i.e., number of dimensions) as ``x``. If an index is negative, the function must determine the element to select along a specified axis (dimension) by counting from the last element (where ``-1`` refers to the last element).
59
50
axis: int
60
-
axis along which to select values. If ``axis`` is negative, the function must determine the axis along which to select values by counting from the last dimension. Default: ``-1``.
51
+
axis along which to select values. If ``axis`` is negative, the function must determine the axis along which to select values by counting from the last dimension (where ``-1`` refers to the last dimension). Default: ``-1``.
61
52
62
53
Returns
63
54
-------
64
55
out: array
65
56
an array having the same data type as ``x``. Must have the same rank (i.e., number of dimensions) as ``x`` and must have a shape determined according to :ref:`broadcasting`, except for the axis (dimension) specified by ``axis`` whose size must equal the size of the corresponding axis (dimension) in ``indices``.
57
+
58
+
Notes
59
+
-----
60
+
61
+
- This specification does not require bounds checking. The behavior for out-of-bounds indices is left unspecified.
0 commit comments