You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: spec/draft/API_specification/array_object.rst
+19-19
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,12 @@ Array object
5
5
6
6
Array API specification for array object attributes and methods.
7
7
8
-
A conforming implementation of the array API standard *must* provide and support an array object having the following attributes and methods.
8
+
A conforming implementation of the array API standard must provide and support an array object having the following attributes and methods.
9
9
10
-
Furthermore, a conforming implementation of the array API standard *must* support, at minimum, array objects of rank (i.e., number of dimensions) ``0``, ``1``, ``2``, ``3``, and ``4`` and *must* explicitly document their maximum supported rank ``N``.
10
+
Furthermore, a conforming implementation of the array API standard must support, at minimum, array objects of rank (i.e., number of dimensions) ``0``, ``1``, ``2``, ``3``, and ``4`` and must explicitly document their maximum supported rank ``N``.
11
11
12
12
.. note::
13
-
Conforming implementations *must* support zero-dimensional arrays.
13
+
Conforming implementations must support zero-dimensional arrays.
14
14
15
15
Apart from array object attributes, such as ``ndim``, ``device``, and ``dtype``, all operations in this standard return arrays (or tuples of arrays), including those operations, such as ``mean``, ``var``, and ``std``, from which some common array libraries (e.g., NumPy) return scalar values.
16
16
@@ -23,12 +23,12 @@ Furthermore, a conforming implementation of the array API standard *must* suppor
23
23
Operators
24
24
---------
25
25
26
-
A conforming implementation of the array API standard *must* provide and support an array object supporting the following Python operators.
26
+
A conforming implementation of the array API standard must provide and support an array object supporting the following Python operators.
27
27
28
28
Arithmetic Operators
29
29
~~~~~~~~~~~~~~~~~~~~
30
30
31
-
A conforming implementation of the array API standard *must* provide and support an array object supporting the following Python arithmetic operators.
31
+
A conforming implementation of the array API standard must provide and support an array object supporting the following Python arithmetic operators.
32
32
33
33
- ``+x``: :meth:`.array.__pos__`
34
34
@@ -75,24 +75,24 @@ A conforming implementation of the array API standard *must* provide and support
:meth:`.array.__lt__`, :meth:`.array.__le__`, :meth:`.array.__gt__`, :meth:`.array.__ge__` are only defined for arrays having real-valued data types. Other comparison operators *should* be defined for arrays having any data type.
166
+
:meth:`.array.__lt__`, :meth:`.array.__le__`, :meth:`.array.__gt__`, :meth:`.array.__ge__` are only defined for arrays having real-valued data types. Other comparison operators should be defined for arrays having any data type.
167
167
For backward compatibility, conforming implementations may support complex numbers; however, inequality comparison of complex numbers is unspecified and thus implementation-dependent (see :ref:`complex-number-ordering`).
168
168
169
169
In-place Operators
170
170
~~~~~~~~~~~~~~~~~~
171
171
172
-
A conforming implementation of the array API standard *must* provide and support an array object supporting the following in-place Python operators.
172
+
A conforming implementation of the array API standard must provide and support an array object supporting the following in-place Python operators.
173
173
174
-
An in-place operation *must not* change the data type or shape of the in-place array as a result of :ref:`type-promotion` or :ref:`broadcasting`.
174
+
An in-place operation must not change the data type or shape of the in-place array as a result of :ref:`type-promotion` or :ref:`broadcasting`.
175
175
176
-
An in-place operation *must* have the same behavior (including special cases) as its respective binary (i.e., two operand, non-assignment) operation. For example, after in-place addition ``x1 += x2``, the modified array ``x1`` *must* always equal the result of the equivalent binary arithmetic operation ``x1 = x1 + x2``.
176
+
An in-place operation must have the same behavior (including special cases) as its respective binary (i.e., two operand, non-assignment) operation. For example, after in-place addition ``x1 += x2``, the modified array ``x1`` must always equal the result of the equivalent binary arithmetic operation ``x1 = x1 + x2``.
177
177
178
178
.. note::
179
-
In-place operators *must* be supported as discussed in :ref:`copyview-mutability`.
179
+
In-place operators must be supported as discussed in :ref:`copyview-mutability`.
180
180
181
181
Arithmetic Operators
182
182
""""""""""""""""""""
@@ -206,12 +206,12 @@ Bitwise Operators
206
206
Reflected Operators
207
207
~~~~~~~~~~~~~~~~~~~
208
208
209
-
A conforming implementation of the array API standard *must* provide and support an array object supporting the following reflected operators.
209
+
A conforming implementation of the array API standard must provide and support an array object supporting the following reflected operators.
210
210
211
-
The results of applying reflected operators *must* match their non-reflected equivalents.
211
+
The results of applying reflected operators must match their non-reflected equivalents.
212
212
213
213
.. note::
214
-
All operators for which ``array <op> scalar`` is implemented *must* have an equivalent reflected operator implementation.
214
+
All operators for which ``array <op> scalar`` is implemented must have an equivalent reflected operator implementation.
Copy file name to clipboardexpand all lines: spec/draft/API_specification/broadcasting.rst
+2-2
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Given an element-wise operation involving two compatible arrays, an array having
19
19
20
20
If two arrays are of unequal rank, the array having a lower rank is promoted to a higher rank by (virtually) prepending singleton dimensions until the number of dimensions matches that of the array having a higher rank.
21
21
22
-
The results of the element-wise operation *must* be stored in an array having a shape determined by the following algorithm.
22
+
The results of the element-wise operation must be stored in an array having a shape determined by the following algorithm.
23
23
24
24
#. Let ``A`` and ``B`` both be arrays.
25
25
@@ -112,7 +112,7 @@ The following examples demonstrate array shapes which do **not** broadcast.
112
112
In-place Semantics
113
113
------------------
114
114
115
-
As implied by the broadcasting algorithm, in-place element-wise operations (including ``__setitem__``) *must not* change the shape of the in-place array as a result of broadcasting. Such operations should only be supported in the case where the right-hand operand can broadcast to the shape of the left-hand operand, after any indexing operations are performed.
115
+
As implied by the broadcasting algorithm, in-place element-wise operations (including ``__setitem__``) must not change the shape of the in-place array as a result of broadcasting. Such operations should only be supported in the case where the right-hand operand can broadcast to the shape of the left-hand operand, after any indexing operations are performed.
0 commit comments