Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s committed Jun 29, 2019
1 parent 378d474 commit e908a8a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions torch_geometric/utils/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def from_scipy_sparse_matrix(A):


def to_networkx(data, node_attrs=None, edge_attrs=None):
r"""Converts a data object graph to a networkx graph.
r"""Converts a :class:`torch_geometric.data.Data` instance to a
:obj:`networkx.DiGraph`.
Args:
data (torch_geometric.data.Data): The data object.
Expand Down Expand Up @@ -73,10 +74,11 @@ def to_networkx(data, node_attrs=None, edge_attrs=None):


def from_networkx(G):
r""""Converts a networkx graph to a data object graph.
r"""Converts a :obj:`networkx.Graph` or :obj:`networkx.DiGraph` to a
:class:`torch_geometric.data.Data` instance.
Args:
G (networkx.Graph): A networkx graph.
G (networkx.Graph or networkx.DiGraph): A networkx graph.
"""

G = G.to_directed() if not nx.is_directed(G) else G
Expand Down

0 comments on commit e908a8a

Please sign in to comment.