latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.linalg.diagonal
- tensorplay.linalg.diagonal()
linalg_diagonal(A, *, offset=0, dim1=-2, dim2=-1) -> Tensor
Returns a view of the diagonals of
A: the two dimensions selected bydim1anddim2are collapsed into the trailing axis of the output, holding the entries of the diagonal shifted byoffset(positive shifts above, negative below the main diagonal).See
tensorplay.diagonal()
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

