Skip to content

Commit 31a3a7f

Browse files
committed
Add a note how stacked array is handled in liear algebra
1 parent ef1ce03 commit 31a3a7f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/reference/linalg.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,19 @@ Exceptions
108108
:nosignatures:
109109

110110
dpnp.linalg.LinAlgError
111+
112+
Linear algebra on several matrices at once
113+
------------------------------------------
114+
115+
Several of the linear algebra routines listed above are able to compute results
116+
for several matrices at once, if they are stacked into the same array.
117+
118+
This is indicated in the documentation via input parameter specifications such
119+
as ``a : (..., M, M) {dpnp.ndarray, usm_ndarray}``. This means that if for
120+
instance given an input array ``a.shape == (N, M, M)``, it is interpreted as a
121+
"stack" of N matrices, each of size M-by-M. Similar specification applies to
122+
return values, for instance the determinant has ``det : (...)`` and will in
123+
this case return an array of shape ``det(a).shape == (N,)``. This generalizes
124+
to linear algebra operations on higher-dimensional arrays: the last 1 or 2
125+
dimensions of a multidimensional array are interpreted as vectors or matrices,
126+
as appropriate for each operation.

0 commit comments

Comments
 (0)