Skip to content

Commit

Permalink
[Doc] Add documentation for DGLGraph.adj_sparse (dmlc#3096)
Browse files Browse the repository at this point in the history
Co-authored-by: Minjie Wang <[email protected]>
  • Loading branch information
BarclayII and jermainewang authored Jul 7, 2021
1 parent 188152b commit 751685a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/api/python/dgl.DGLGraph.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ Methods for getting the adjacency and the incidence matrix of the graph.
:toctree: ../../generated/

DGLGraph.adj
DGLGraph.adj_sparse
DGLGraph.adjacency_matrix
DGLGraph.inc
DGLGraph.incidence_matrix
Expand Down
2 changes: 2 additions & 0 deletions python/dgl/heterograph.py
Original file line number Diff line number Diff line change
Expand Up @@ -3619,7 +3619,9 @@ def adj_sparse(self, fmt, etype=None):
--------
>>> g = dgl.graph(([0, 1, 2], [1, 2, 3]))
>>> g.adj_sparse('coo')
(tensor([0, 1, 2]), tensor([1, 2, 3]))
>>> g.adj_sparse('csr')
(tensor([0, 1, 2, 3, 3]), tensor([1, 2, 3]), tensor([0, 1, 2]))
"""
etid = self.get_etype_id(etype)
if fmt == 'csc':
Expand Down

0 comments on commit 751685a

Please sign in to comment.