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

Faster fgraph change during opt.

This make Merge Optimzer take 21s instead of 35s in one case. I think this work correctly in case of revert.
上级 f5df680d
......@@ -226,10 +226,8 @@ class FunctionGraph(utils.object2):
if NullType is None:
from null_type import NullType
# Imports the owners of the variables
r_owner_done = set(self.apply_nodes)
for apply_node in [r.owner for r in variables if r.owner is not None]:
if apply_node not in r_owner_done:
r_owner_done.add(apply_node)
if apply_node not in self.apply_nodes:
self.__import__(apply_node, reason=reason)
for r in variables:
if r.owner is None and not isinstance(r, graph.Constant) and r not in self.inputs:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论