diff --git a/docs/source/api/python/dgl.DGLGraph.rst b/docs/source/api/python/dgl.DGLGraph.rst index a27a9525bc47..e3fd9fe14a1d 100644 --- a/docs/source/api/python/dgl.DGLGraph.rst +++ b/docs/source/api/python/dgl.DGLGraph.rst @@ -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 diff --git a/python/dgl/heterograph.py b/python/dgl/heterograph.py index 0dc329dfa2ed..29c3849cb95c 100644 --- a/python/dgl/heterograph.py +++ b/python/dgl/heterograph.py @@ -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':