提交 101be6f8 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Make sure to pass all arguments to linker.__init__

上级 58f9cc77
...@@ -1560,7 +1560,7 @@ class _Linker(gof.link.LocalLinker): ...@@ -1560,7 +1560,7 @@ class _Linker(gof.link.LocalLinker):
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:
assert type(self) is _Linker assert type(self) is _Linker
return type(self)(self.fgraph, self.maker).accept(fgraph, no_recycling) return type(self)(maker=self.maker).accept(fgraph, no_recycling)
self.fgraph = fgraph self.fgraph = fgraph
self.no_recycling = no_recycling self.no_recycling = no_recycling
return self return self
......
...@@ -1408,8 +1408,11 @@ class OpWiseCLinker(link.LocalLinker): ...@@ -1408,8 +1408,11 @@ class OpWiseCLinker(link.LocalLinker):
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.fallback_on_perform).accept(fgraph, return type(self)(
no_recycling) fallback_on_perform=self.fallback_on_perform,
allow_gc=self.allow_gc,
nice_errors=self.nice_errors
).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.")
self.fgraph = fgraph self.fgraph = fgraph
......
...@@ -433,7 +433,7 @@ class PerformLinker(LocalLinker): ...@@ -433,7 +433,7 @@ class PerformLinker(LocalLinker):
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)(allow_gc=self.allow_gc).accept(fgraph, no_recycling)
#raise Exception("Cannot accept from a Linker that is already tied to another FunctionGraph.") #raise Exception("Cannot accept from a Linker that is already tied to another FunctionGraph.")
self.fgraph = fgraph self.fgraph = fgraph
self.no_recycling = no_recycling self.no_recycling = no_recycling
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论