Unverified Commit 751685a9 authored by Quan (Andy) Gan's avatar Quan (Andy) Gan Committed by GitHub
Browse files

[Doc] Add documentation for DGLGraph.adj_sparse (#3096)


Co-authored-by: default avatarMinjie Wang <wmjlyjemaine@gmail.com>
parent 188152b8
...@@ -143,6 +143,7 @@ Methods for getting the adjacency and the incidence matrix of the graph. ...@@ -143,6 +143,7 @@ Methods for getting the adjacency and the incidence matrix of the graph.
:toctree: ../../generated/ :toctree: ../../generated/
DGLGraph.adj DGLGraph.adj
DGLGraph.adj_sparse
DGLGraph.adjacency_matrix DGLGraph.adjacency_matrix
DGLGraph.inc DGLGraph.inc
DGLGraph.incidence_matrix DGLGraph.incidence_matrix
......
...@@ -3619,7 +3619,9 @@ class DGLHeteroGraph(object): ...@@ -3619,7 +3619,9 @@ class DGLHeteroGraph(object):
-------- --------
>>> g = dgl.graph(([0, 1, 2], [1, 2, 3])) >>> g = dgl.graph(([0, 1, 2], [1, 2, 3]))
>>> g.adj_sparse('coo') >>> g.adj_sparse('coo')
(tensor([0, 1, 2]), tensor([1, 2, 3]))
>>> g.adj_sparse('csr') >>> g.adj_sparse('csr')
(tensor([0, 1, 2, 3, 3]), tensor([1, 2, 3]), tensor([0, 1, 2]))
""" """
etid = self.get_etype_id(etype) etid = self.get_etype_id(etype)
if fmt == 'csc': if fmt == 'csc':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment