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/extensions/linear_algebra_functions.md
+8-26
Original file line number
Diff line number
Diff line change
@@ -140,23 +140,15 @@ Returns the determinant of a square matrix (or stack of square matrices) `x`.
140
140
- if `x` is a two-dimensional array, a zero-dimensional array containing the determinant; otherwise, a non-zero dimensional array containing the determinant for each square matrix. The returned array must have the same data type as `x`.
Returns the specified diagonals. If `x` has more than two dimensions, then the axes (dimensions) specified by `axis1` and `axis2` are used to determine the two-dimensional sub-arrays from which to return diagonals.
145
+
Returns the specified diagonals of a matrix (or a stack of matrices) `x`.
146
146
147
147
#### Parameters
148
148
149
149
-**x**: _<array>_
150
150
151
-
- input array. Must have at least `2` dimensions.
152
-
153
-
-**axis1**: _int_
154
-
155
-
- first axis (dimension) with respect to which to take diagonal. Default: `0`.
156
-
157
-
-**axis2**: _int_
158
-
159
-
- second axis (dimension) with respect to which to take diagonal. Default: `1`.
151
+
- input array having shape `(..., M, N)` and whose innermost two dimensions form `MxN` matrices.
160
152
161
153
-**offset**: _int_
162
154
@@ -172,7 +164,7 @@ Returns the specified diagonals. If `x` has more than two dimensions, then the a
172
164
173
165
-**out**: _<array>_
174
166
175
-
-if `x` is a two-dimensional array, a one-dimensional array containing the diagonal; otherwise, a multi-dimensional array containing the diagonals and whose shape is determined by removing `axis1` and `axis2` and appending a dimension equal to the size of the resulting diagonals. The returned array must have the same data type as `x`.
167
+
-an arraycontaining 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`.
176
168
177
169
(function-linalg-eig)=
178
170
### linalg.eig()
@@ -593,23 +585,15 @@ Computes the singular values of a matrix (or a stack of matrices) `x`.
593
585
- 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`.
Returns the sum along the specified diagonals. If `x` has more than two dimensions, then the axes (dimensions) specified by `axis1` and `axis2` are used to determine the two-dimensional sub-arrays for which to compute the trace.
590
+
Returns the sum along the specified diagonals of a matrix (or a stack of matrices) `x`.
599
591
600
592
#### Parameters
601
593
602
594
-**x**: _<array>_
603
595
604
-
- input array. Must have at least `2` dimensions. Should have a numeric data type.
605
-
606
-
-**axis1**: _int_
607
-
608
-
- first axis (dimension) with respect to which to compute the trace. Default: `0`.
609
-
610
-
-**axis2**: _int_
611
-
612
-
- second axis (dimension) with respect to which to compute the trace. Default: `1`.
596
+
- input array having shape `(..., M, N)` and whose innermost two dimensions form `MxN` matrices. Should have a numeric data type.
613
597
614
598
-**offset**: _int_
615
599
@@ -625,9 +609,7 @@ Returns the sum along the specified diagonals. If `x` has more than two dimensio
625
609
626
610
-**out**: _<array>_
627
611
628
-
- if `x` is a two-dimensional array, the returned array must be a zero-dimensional array containing the trace; otherwise, the returned array must be a multi-dimensional array containing the traces.
629
-
630
-
The shape of a multi-dimensional output array is determined by removing `axis1` and `axis2` and storing the traces in the last array dimension. For example, if `x` has rank `k` and shape `(I, J, K, ..., L, M, N)` and `axis1=-2` and `axis1=-1`, then a multi-dimensional output array has rank `k-2` and shape `(I, J, K, ..., L)` where
612
+
- an array containing the traces and whose shape is determined by removing the last two dimensions and storing the traces in the last array dimension. For example, if `x` has rank `k` and shape `(I, J, K, ..., L, M, N)`, then an output array has rank `k-2` and shape `(I, J, K, ..., L)` where
0 commit comments