dgl.sparse.SparseMatrix.indices
- SparseMatrix.indices() Tensor [source]
以形状为
(2, nnz)
的一个 Tensor 返回坐标列表 (COO) 表示。参见 维基百科上的 COO。
- 返回:
形状为
(2, nnz)
的堆叠 COO tensor。- 返回类型:
torch.Tensor
示例
>>> indices = torch.tensor([[1, 2, 1], [2, 4, 3]]) >>> A = dglsp.spmatrix(indices) >>> A.indices() tensor([[1, 2, 1], [2, 4, 3]])