提交 2e2081fc authored 作者: Ian Goodfellow's avatar Ian Goodfellow

inlined _build_doort_impact

上级 95b0c9a0
...@@ -727,11 +727,6 @@ class DestroyHandler(toolbox.Bookkeeper): ...@@ -727,11 +727,6 @@ class DestroyHandler(toolbox.Bookkeeper):
(see docstrings for these properties above) (see docstrings for these properties above)
""" """
if self.stale_droot: if self.stale_droot:
self.droot, self.impact, self.root_destroyer = self._build_droot_impact()
self.stale_droot = False
return self.droot, self.impact, self.root_destroyer
def _build_droot_impact(self):
droot = {} # destroyed view + nonview variables -> foundation droot = {} # destroyed view + nonview variables -> foundation
impact = {} # destroyed nonview variable -> it + all views of it impact = {} # destroyed nonview variable -> it + all views of it
root_destroyer = {} # root -> destroyer apply root_destroyer = {} # root -> destroyer apply
...@@ -747,8 +742,6 @@ class DestroyHandler(toolbox.Bookkeeper): ...@@ -747,8 +742,6 @@ class DestroyHandler(toolbox.Bookkeeper):
raise InconsistencyError("Multiple destroyers of %s" % input_root) raise InconsistencyError("Multiple destroyers of %s" % input_root)
droot[input_root] = input_root droot[input_root] = input_root
root_destroyer[input_root] = app root_destroyer[input_root] = app
#input_impact = set([input_root])
#add_impact(input_root, self.view_o, input_impact)
input_impact = get_impact(input_root, self.view_o) input_impact = get_impact(input_root, self.view_o)
for v in input_impact: for v in input_impact:
assert v not in droot assert v not in droot
...@@ -756,8 +749,9 @@ class DestroyHandler(toolbox.Bookkeeper): ...@@ -756,8 +749,9 @@ class DestroyHandler(toolbox.Bookkeeper):
impact[input_root] = input_impact impact[input_root] = input_impact
impact[input_root].add(input_root) impact[input_root].add(input_root)
self.droot, self.impact, self.root_destroyer = droot, impact, root_destroyer
return droot, impact, root_destroyer self.stale_droot = False
return self.droot, self.impact, self.root_destroyer
def on_detach(self, fgraph): def on_detach(self, fgraph):
if fgraph is not self.fgraph: if fgraph is not self.fgraph:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论