From 9f30307b9e8c1ce14b45b45408f3a5cd7b3a685e Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Mon, 23 Dec 2024 23:41:12 +0000 Subject: [PATCH 1/2] doc: leave `take` undefined for 0-d --- src/array_api_stubs/_draft/indexing_functions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/array_api_stubs/_draft/indexing_functions.py b/src/array_api_stubs/_draft/indexing_functions.py index a9b38b482..102e202d7 100644 --- a/src/array_api_stubs/_draft/indexing_functions.py +++ b/src/array_api_stubs/_draft/indexing_functions.py @@ -33,10 +33,15 @@ def take(x: array, indices: array, /, *, axis: Optional[int] = None) -> array: Notes ----- + Behavior for 0-dimensional arrays is unspecified. + .. versionadded:: 2022.12 .. versionchanged:: 2023.12 Out-of-bounds behavior is explicitly left unspecified. + + .. versionchanged:: 2024.12 + Behavior for 0-dimensional arrays is explicitly left unspecified. """ From a4bb9a9bec7c1ee6e40758540371ad2a8eb2b50a Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 8 Jan 2025 23:42:54 -0800 Subject: [PATCH 2/2] docs: update language to match `cumulative_sum` --- src/array_api_stubs/_draft/indexing_functions.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/array_api_stubs/_draft/indexing_functions.py b/src/array_api_stubs/_draft/indexing_functions.py index 102e202d7..536317dbb 100644 --- a/src/array_api_stubs/_draft/indexing_functions.py +++ b/src/array_api_stubs/_draft/indexing_functions.py @@ -13,7 +13,7 @@ def take(x: array, indices: array, /, *, axis: Optional[int] = None) -> array: Parameters ---------- x: array - input array. + input array. Should have one or more dimensions (axes). indices: array array indices. The array must be one-dimensional and have an integer data type. @@ -33,15 +33,12 @@ def take(x: array, indices: array, /, *, axis: Optional[int] = None) -> array: Notes ----- - Behavior for 0-dimensional arrays is unspecified. + - When ``x`` is a zero-dimensional array, behavior is unspecified and thus implementation-defined. .. versionadded:: 2022.12 .. versionchanged:: 2023.12 Out-of-bounds behavior is explicitly left unspecified. - - .. versionchanged:: 2024.12 - Behavior for 0-dimensional arrays is explicitly left unspecified. """