提交 c7ee60ff authored 作者: Frederic's avatar Frederic

Fix test crash in DebugMode. We make the toposort of the same type as all other places.

It was a set, not it is now a list. This cause problem in the error handling code where we try to get the index in a set. That isn't defined.
上级 13464d90
...@@ -1636,7 +1636,7 @@ class _Linker(gof.link.LocalLinker): ...@@ -1636,7 +1636,7 @@ class _Linker(gof.link.LocalLinker):
if not isinstance(node.op, gof.op.Op): if not isinstance(node.op, gof.op.Op):
raise utils.MethodNotDefined() raise utils.MethodNotDefined()
e = FunctionGraph(*graph.clone(node.inputs, node.outputs)) e = FunctionGraph(*graph.clone(node.inputs, node.outputs))
e.toposort = lambda: e.apply_nodes # WARNING: STOCHASTIC ORDER e.toposort = lambda: list(e.apply_nodes) # WARNING: STOCHASTIC ORDER
# Specifically... e.nodes is a set, but of only 1 element # Specifically... e.nodes is a set, but of only 1 element
cl = CLinker().accept(e, [r for r, r2 in zip(e.outputs, cl = CLinker().accept(e, [r for r, r2 in zip(e.outputs,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论