r"""Returns the coordinate list (COO) representation of the sparse matrix. See `COO in Wikipedia `_. Returns ------- torch.Tensor Row coordinate torch.Tensor
(self)
| 92 | return self.coo()[1] |
| 93 | |
| 94 | def coo(self) -> Tuple[torch.Tensor, torch.Tensor]: |
| 95 | r"""Returns the coordinate list (COO) representation of the sparse |
| 96 | matrix. |
| 97 | |
| 98 | See `COO in Wikipedia <https://en.wikipedia.org/wiki/ |
| 99 | Sparse_matrix#Coordinate_list_(COO)>`_. |
| 100 | |
| 101 | Returns |
| 102 | ------- |
| 103 | torch.Tensor |
| 104 | Row coordinate |
| 105 | torch.Tensor |
| 106 | Column coordinate |
| 107 | |
| 108 | Examples |
| 109 | -------- |
| 110 | |
| 111 | >>> indices = torch.tensor([[1, 2, 1], [2, 4, 3]]) |
| 112 | >>> A = dglsp.spmatrix(indices) |
| 113 | >>> A.coo() |
| 114 | (tensor([1, 2, 1]), tensor([2, 4, 3])) |
| 115 | """ |
| 116 | return self.c_sparse_matrix.coo() |
| 117 | |
| 118 | def indices(self) -> torch.Tensor: |
| 119 | r"""Returns the coordinate list (COO) representation in one tensor with |
no outgoing calls