Skip to content

Commit d95df16

Browse files
authored
feat: add support for negative axes to permute_dims
PR-URL: data-apis#980 Reviewed-by: Ralf Gommers <[email protected]> Reviewed-by: Evgeni Burovski
1 parent a4c30eb commit d95df16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/array_api_stubs/_draft/manipulation_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def permute_dims(x: array, /, axes: Tuple[int, ...]) -> array:
159159
x: array
160160
input array.
161161
axes: Tuple[int, ...]
162-
tuple containing a permutation of ``(0, 1, ..., N-1)`` where ``N`` is the number of axes in ``x``.
162+
tuple containing a permutation of axes. A valid axis **must** be an integer on the interval ``[-N, N)``, where ``N`` is the number of axes in ``x``. If an axis is specified as a negative integer, the function **must** determine the respective axis index by counting backward from the last axis (where ``-1`` refers to the last axis). If provided an invalid axis, the function **must** raise an exception.
163163
164164
Returns
165165
-------

0 commit comments

Comments
 (0)