Skip to content

Commit acf50b7

Browse files
authored
Fix axis description in expand_dims (#387)
1 parent 2b9c402 commit acf50b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/API_specification/signatures/manipulation_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def expand_dims(x: array, /, *, axis: int = 0) -> array:
2929
x: array
3030
input array.
3131
axis: int
32-
axis position. Must follow Python's indexing rules: zero-based and negative indices must be counted backward from the last dimension. If ``x`` has rank ``N``, a valid ``axis`` must reside on the interval ``[-N-1, N+1]``. An ``IndexError`` exception must be raised if provided an invalid ``axis`` position.
32+
axis position (zero-based). If ``x`` has rank (i.e, number of dimensions) ``N``, a valid ``axis`` must reside on the closed-interval ``[-N-1, N]``. If provided a negative ``axis``, the axis position at which to insert a singleton dimension must be computed as ``N + axis + 1``. Hence, if provided ``-1``, the resolved axis position must be ``N`` (i.e., a singleton dimension must be appended to the input array ``x``). If provided ``-N-1``, the resolved axis position must be ``0`` (i.e., a singleton dimension must be prepended to the input array ``x``). An ``IndexError`` exception must be raised if provided an invalid ``axis`` position.
3333
3434
Returns
3535
-------

0 commit comments

Comments
 (0)