dgl.sparse.SparseMatrix.indices

SparseMatrix.indices() Tensor[source]

返回一个形状为(2, nnz)的张量中的坐标列表(COO)表示。

参见 COO in Wikipedia.

Returns:

堆叠的COO张量,形状为(2, nnz)

Return type:

torch.Tensor

示例

>>> indices = torch.tensor([[1, 2, 1], [2, 4, 3]])
>>> A = dglsp.spmatrix(indices)
>>> A.indices()
tensor([[1, 2, 1],
        [2, 4, 3]])