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

[Bug] fixing from_edge_list (#1615)


Co-authored-by: default avatarChao Ma <mctt90@gmail.com>
Co-authored-by: default avatarJinjing Zhou <VoVAllen@users.noreply.github.com>
parent 3ebf2660
...@@ -1332,7 +1332,7 @@ class DGLGraph(DGLBaseGraph): ...@@ -1332,7 +1332,7 @@ class DGLGraph(DGLBaseGraph):
Notes Notes
----- -----
The nodes and edges in the graph would be re-indexed after the removal. The edges in the graph would be re-indexed after the removal. The nodes are preserved.
Examples Examples
-------- --------
......
...@@ -1171,9 +1171,6 @@ def from_edge_list(elist, readonly): ...@@ -1171,9 +1171,6 @@ def from_edge_list(elist, readonly):
src_ids = utils.toindex(src) src_ids = utils.toindex(src)
dst_ids = utils.toindex(dst) dst_ids = utils.toindex(dst)
num_nodes = max(src.max(), dst.max()) + 1 num_nodes = max(src.max(), dst.max()) + 1
min_nodes = min(src.min(), dst.min())
if min_nodes != 0:
raise DGLError('Invalid edge list. Nodes must start from 0.')
return from_coo(num_nodes, src_ids, dst_ids, readonly) return from_coo(num_nodes, src_ids, dst_ids, readonly)
def map_to_subgraph_nid(induced_nodes, parent_nids): def map_to_subgraph_nid(induced_nodes, parent_nids):
......
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