提交 7e6662cc authored 作者: Ziye Fan's avatar Ziye Fan

patch

上级 ec3c9754
......@@ -402,6 +402,7 @@ class FunctionGraph(utils.object2):
if var.clients]):
self.variables.remove(variable)
del variable.fgraph
def __prune__(self, apply_node, reason=None):
"""Always called on owner of pruned variable from the graph.
......
......@@ -597,9 +597,12 @@ class MergeOptimizer(Optimizer):
# doing the full cycle check. The full cycle check is
# skipped by validate() if the graph don't contain
# destroyers.
node = pairs[0][0]
var = pairs[0][0]
candidate = pairs[0][1]
if node.owner and candidate.owner:
if (not hasattr(var, 'fgraph') or
not hasattr(candidate, 'fgraph')):
continue
if var.owner and candidate.owner:
node = node.owner
candidate = candidate.owner
inputs_match = all(node_in is cand_in
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论