dgl.sparse.DiagMatrix.transpose

DiagMatrix.transpose()[source]

Returns a matrix that is a transposed version of the diagonal matrix.

Returns

The transpose of the matrix

Return type

DiagMatrix

Examples

>>> val = torch.arange(1, 5).float()
>>> D = dglsp.diag(val, shape=(4, 5))
>>> D.transpose()
DiagMatrix(val=tensor([1., 2., 3., 4.]),
           shape=(5, 4))