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
* Add a cross-reference to the linalg extension in the linear algebra section
* Fix a reference to transpose() to matrix_transpose()
* Remove TODO-ed linalg functions eig() and eigvals()
Instead just reference that they will be added in a later version of the spec
in notes.
* Use a better header title for the linear algebra extension page
* Fix the return type annotation for svdvals
The annotation was based on a previous version where the return type was
polymorphic.
* Fix the type hints for vector_norm()
* Remove comment
Co-authored-by: Athan <kgryte@gmail.com>
Copy file name to clipboardExpand all lines: spec/extensions/linear_algebra_functions.md
+15-14Lines changed: 15 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
-
# Linear Algebra Functions
1
+
(linear-algebra-extension)=
2
+
# Linear Algebra Extension
2
3
3
4
> Array API specification for linear algebra functions.
4
5
@@ -37,7 +38,7 @@ Accordingly, the standardization process affords the opportunity to reduce inter
37
38
38
39
Lastly, certain operations may be performed independent of data type, and, thus, the associated interfaces should support all data types specified in this standard. Example operations include:
39
40
40
-
-`transpose`: computing the transpose.
41
+
-`matrix_transpose`: computing the transpose.
41
42
-`diagonal`: returning the diagonal.
42
43
43
44
3.**Return values**: if an interface has more than one return value, the interface should return a namedtuple consisting of each value.
@@ -166,11 +167,6 @@ Returns the specified diagonals of a matrix (or a stack of matrices) `x`.
166
167
167
168
- an array containing the diagonals and whose shape is determined by removing the last two dimensions and appending a dimension equal to the size of the resulting diagonals. The returned array must have the same data type as `x`.
168
169
169
-
(function-linalg-eig)=
170
-
### linalg.eig()
171
-
172
-
_TODO: this requires complex number support to be added to the specification._
173
-
174
170
(function-linalg-eigh)=
175
171
### linalg.eigh(x, /)
176
172
@@ -200,10 +196,10 @@ Returns the eigenvalues and eigenvectors of a symmetric matrix (or a stack of sy
200
196
Eigenvalue sort order is left unspecified.
201
197
```
202
198
203
-
(function-linalg-eigvals)=
204
-
### linalg.eigvals()
205
-
206
-
_TODO: this requires complex number support to be added to the specification._
199
+
```{note}
200
+
The function `eig` will be added in a future version of the specification,
201
+
as it requires complex number support.
202
+
```
207
203
208
204
(function-linalg-eigvalsh)=
209
205
### linalg.eigvalsh(x, /)
@@ -229,6 +225,11 @@ Computes the eigenvalues of a symmetric matrix (or a stack of symmetric matrices
229
225
Eigenvalue sort order is left unspecified.
230
226
```
231
227
228
+
```{note}
229
+
The function `eigvals` will be added in a future version of the specification,
230
+
as it requires complex number support.
231
+
```
232
+
232
233
(function-linalg-inv)=
233
234
### linalg.inv(x, /)
234
235
@@ -512,7 +513,7 @@ Computes the singular values of a matrix (or a stack of matrices) `x`.
- an array with shape `(..., K)` that contains the vector(s) of singular values of length `K`. For each vector, the singular values must be sorted in descending order by magnitude, such that `s[..., 0]` is the largest value, `s[..., 1]` is the second largest value, et cetera. The first `x.ndim-2` dimensions must have the same shape as those of the input `x`. The returned array must have the same floating-point data type as `x`.
518
519
@@ -570,15 +571,15 @@ Computes the vector norm of a vector (or batch of vectors) `x`.
570
571
571
572
- input array. Should have a floating-point data type.
- If an integer, `axis` specifies the axis (dimension) along which to compute vector norms. If an n-tuple, `axis` specifies the axes (dimensions) along which to compute batched vector norms. If `None`, the vector norm must be computed over all array values (i.e., equivalent to computing the vector norm of a flattened array). Negative indices must be supported. Default: `None`.
576
577
577
578
- **keepdims**: _bool_
578
579
579
580
- If `True`, the axes (dimensions) specified by `axis` must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array (see {ref}`broadcasting`). Otherwise, if `False`, the axes (dimensions) specified by `axis` must not be included in the result. Default: `False`.
0 commit comments