Skip to content

Commit

Permalink
[BUGFix][Test] fix random bfs failure (dmlc#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
BarclayII authored and jermainewang committed Jun 6, 2019
1 parent 21ff161 commit da0c92a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/compute/test_traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ def _bfs_nx(g_nx, src):
edges_nx.append(edge_frontier)
frontier = set([v])
edge_frontier = set([g.edge_id(u, v)])
layers_nx.append(frontier)
edges_nx.append(edge_frontier)
# avoids case of no successors
if len(frontier) > 0 and len(edge_frontier) > 0:
layers_nx.append(frontier)
edges_nx.append(edge_frontier)
return layers_nx, edges_nx

g = dgl.DGLGraph()
Expand Down

0 comments on commit da0c92a

Please sign in to comment.