dgl.sparse.DiagMatrix.double

DiagMatrix.double()[source]

Converts the matrix values to double data type. If the matrix already uses double data type, the original matrix will be returned.

Returns

The matrix with double values

Return type

DiagMatrix

Examples

>>> val = torch.ones(2)
>>> D = dglsp.diag(val)
>>> D.double()
DiagMatrix(values=tensor([1., 1.], dtype=torch.float64),
           shape=(2, 2))