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

Correctly pass the schedule

上级 4011cbe4
...@@ -547,9 +547,7 @@ class CLinker(link.Linker): ...@@ -547,9 +547,7 @@ class CLinker(link.Linker):
if no_recycling is None: if no_recycling is None:
no_recycling = [] no_recycling = []
if self.fgraph is not None and self.fgraph is not fgraph: if self.fgraph is not None and self.fgraph is not fgraph:
return type(self)().accept(fgraph, no_recycling) return type(self)(self.schedule).accept(fgraph, no_recycling)
# raise Exception("Cannot accept from a Linker that is already"
# " tied to another FunctionGraph.")
self.fgraph = fgraph self.fgraph = fgraph
self.fetch_variables() self.fetch_variables()
self.no_recycling = no_recycling self.no_recycling = no_recycling
...@@ -1720,7 +1718,8 @@ class OpWiseCLinker(link.LocalLinker): ...@@ -1720,7 +1718,8 @@ class OpWiseCLinker(link.LocalLinker):
return type(self)( return type(self)(
fallback_on_perform=self.fallback_on_perform, fallback_on_perform=self.fallback_on_perform,
allow_gc=self.allow_gc, allow_gc=self.allow_gc,
nice_errors=self.nice_errors nice_errors=self.nice_errors,
schedule=self.schedule,
).accept(fgraph, no_recycling) ).accept(fgraph, no_recycling)
# raise Exception("Cannot accept from a Linker that is # raise Exception("Cannot accept from a Linker that is
# already tied to another FunctionGraph.") # already tied to another FunctionGraph.")
...@@ -1873,7 +1872,8 @@ class DualLinker(link.Linker): ...@@ -1873,7 +1872,8 @@ class DualLinker(link.Linker):
if no_recycling is None: if no_recycling is None:
no_recycling = [] no_recycling = []
if self.fgraph is not None and self.fgraph is not fgraph: if self.fgraph is not None and self.fgraph is not fgraph:
return type(self)(self.checker).accept(fgraph, no_recycling) return type(self)(self.checker, self.schedule).accept(
fgraph, no_recycling)
self.fgraph = fgraph self.fgraph = fgraph
self.no_recycling = no_recycling self.no_recycling = no_recycling
return self return self
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论