# tensorplay.linalg.diagonal Source: https://www.tensorplay.cn/docs/generated/tensorplay.linalg.diagonal.html ```python 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 by dim1 and dim2 are collapsed into the trailing axis of the output, holding the entries of the diagonal shifted by offset (positive shifts above, negative below the main diagonal). See tensorplay.diagonal()