Commit 6858ed54 authored by Minjie Wang's avatar Minjie Wang
Browse files

WIP: topdown example

parent 5b5baee1
...@@ -244,9 +244,14 @@ class DGLGraph(DiGraph): ...@@ -244,9 +244,14 @@ class DGLGraph(DiGraph):
preds = defaultdict(list) preds = defaultdict(list)
for uu, vv in utils.edge_iter(u, v): for uu, vv in utils.edge_iter(u, v):
preds[vv].append(uu) preds[vv].append(uu)
dst = preds.keys() if len(preds) == 1:
src = [preds[d] for d in dst] dst = list(preds.keys())[0]
self.recvfrom(dst, src) src = preds[dst]
self.recvfrom(dst, src)
elif len(preds) > 1:
dst = list(preds.keys())
src = [preds[d] for d in dst]
self.recvfrom(dst, src)
def update_to(self, u): def update_to(self, u):
"""Pull messages from the node's predecessors and then update it. """Pull messages from the node's predecessors and then update it.
......
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