Skip to content

Commit db2f101

Browse files
authored
Merge branch 'main' into scalar-where
2 parents 4fa6d98 + fd6f507 commit db2f101

File tree

15 files changed

+144
-33
lines changed

15 files changed

+144
-33
lines changed

spec/draft/API_specification/searching_functions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Objects in API
2222

2323
argmax
2424
argmin
25+
count_nonzero
2526
nonzero
2627
searchsorted
2728
where

spec/draft/API_specification/statistical_functions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Objects in API
1818
:toctree: generated
1919
:template: method.rst
2020

21+
cumulative_prod
2122
cumulative_sum
2223
max
2324
mean

spec/draft/design_topics/copies_views_and_mutation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Copy-view behaviour and mutability
66
.. admonition:: Mutating views
77
:class: important
88

9-
Array API consumers are *strongly* advised to avoid *any* mutating operations when an array object may be either a "view" (i.e., an array whose data refers to memory that belongs to another array) or own memory of which one or more other array objects may be views. This admonition may become more strict in the future (e.g., this specification may require that view mutation be prohibited and trigger an exception). Accordingly, only perform mutation operations (e.g., in-place assignment) when absolutely confident that array data belongs to one, and only one, array object.
9+
Array API consumers are *strongly* advised to avoid *any* mutating operations when an array object may either be a "view" (i.e., an array whose data refers to memory that belongs to another array) or own memory of which one or more other array objects may be views. This admonition may become more strict in the future (e.g., this specification may require that view mutation be prohibited and trigger an exception). Accordingly, only perform mutation operations (e.g., in-place assignment) when absolutely confident that array data belongs to one, and only one, array object.
1010

1111
Strided array implementations (e.g. NumPy, PyTorch, CuPy, MXNet) typically
1212
have the concept of a "view", meaning an array containing data in memory that

spec/draft/purpose_and_scope.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ all the functions, arguments, data types, syntax, and semantics described in
410410
this specification.
411411

412412
A conforming implementation of the array API standard may provide additional
413-
values, objects, properties, data types, and functions beyond those described
414-
in this specification.
413+
features (e.g., values, objects, properties, data types, functions, and function
414+
arguments) beyond those described in this specification.
415415

416416
Libraries which aim to provide a conforming implementation but haven't yet
417417
completed such an implementation may, and are encouraged to, provide details on

src/array_api_stubs/_2021_12/linalg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ def trace(x: array, /, *, offset: int = 0) -> array:
474474
"""
475475

476476

477-
def vecdot(x1: array, x2: array, /, *, axis: int = None) -> array:
477+
def vecdot(x1: array, x2: array, /, *, axis: int = -1) -> array:
478478
"""
479479
Alias for :func:`~array_api.vecdot`.
480480
"""

src/array_api_stubs/_2021_12/searching_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def where(condition: array, x1: array, x2: array, /) -> array:
6969
Parameters
7070
----------
7171
condition: array
72-
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
72+
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Should have a boolean data type. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
7373
x1: array
7474
first input array. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
7575
x2: array

src/array_api_stubs/_2022_12/linalg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ def trace(x: array, /, *, offset: int = 0, dtype: Optional[dtype] = None) -> arr
755755
"""
756756

757757

758-
def vecdot(x1: array, x2: array, /, *, axis: int = None) -> array:
758+
def vecdot(x1: array, x2: array, /, *, axis: int = -1) -> array:
759759
"""Alias for :func:`~array_api.vecdot`."""
760760

761761

src/array_api_stubs/_2022_12/searching_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def where(condition: array, x1: array, x2: array, /) -> array:
9191
Parameters
9292
----------
9393
condition: array
94-
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
94+
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Should have a boolean data type. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
9595
x1: array
9696
first input array. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
9797
x2: array

src/array_api_stubs/_2023_12/linalg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ def trace(x: array, /, *, offset: int = 0, dtype: Optional[dtype] = None) -> arr
781781
"""
782782

783783

784-
def vecdot(x1: array, x2: array, /, *, axis: int = None) -> array:
784+
def vecdot(x1: array, x2: array, /, *, axis: int = -1) -> array:
785785
"""Alias for :func:`~array_api.vecdot`."""
786786

787787

src/array_api_stubs/_2023_12/searching_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def where(condition: array, x1: array, x2: array, /) -> array:
146146
Parameters
147147
----------
148148
condition: array
149-
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
149+
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Should have a boolean data type. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
150150
x1: array
151151
first input array. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
152152
x2: array

0 commit comments

Comments
 (0)