Skip to content

Commit 67eaae1

Browse files
committed
docs: update copy
1 parent aa0b8a1 commit 67eaae1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/array_api_stubs/_draft/manipulation_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ def expand_dims(x: array, /, axis: Union[int, Tuple[int, ...]]) -> array:
9191
axis position(s) (zero-based). If ``axis`` is an integer,
9292
9393
- a valid axis position **must** reside on the closed-interval ``[-N-1, N]``, where ``N`` is the number of dimensions in ``x``.
94-
- if an axis position is specified as a negative integer, the axis position at which to insert a singleton dimension **must** be computed as ``N + axis + 1``. For example, if provided ``-1``, the resolved axis position **must** be ``N`` (i.e., a singleton dimension **must** be appended to the input array ``x``). Similarly, if provided ``-N-1``, the resolved axis position **must** be ``0`` (i.e., a singleton dimension **must** be prepended to the input array ``x``).
94+
- if an axis position is specified as a negative integer, the axis position of the inserted singleton dimension in the output array **must** be computed as ``N + axis + 1``. For example, if provided ``-1``, the resolved axis position **must** be ``N`` (i.e., a singleton dimension **must** be appended to the input array ``x``). Similarly, if provided ``-N-1``, the resolved axis position **must** be ``0`` (i.e., a singleton dimension **must** be prepended to the input array ``x``).
9595
- if provided an invalid axis position, the function **must** raise an exception.
9696
9797
If ``axis`` is a tuple,
9898
9999
- a valid axis position **must** reside on the closed-interval ``[-M-1, M]``, where ``M = N + len(axis) - 1`` and ``N`` is the number of dimensions in ``x``.
100-
- if an entry is a negative integer, the axis position at which to insert a singleton dimension **must** be computed as ``M + axis + 1``.
100+
- if an entry is a negative integer, the axis position of the inserted singleton dimension in the output array **must** be computed as ``M + axis + 1``.
101101
- each entry of ``axis`` must resolve to a unique positive axis position.
102102
- for each entry of ``axis``, the corresponding dimension in the expanded output array **must** be a singleton dimension.
103103
- for the remaining dimensions of the expanded output array, the output array dimensions **must** correspond to the dimensions of ``x`` in order.

0 commit comments

Comments
 (0)