提交 7dea79aa authored 作者: Frederic Bastien's avatar Frederic Bastien

Reformating to make it more similar to the original one

上级 ed32cd9c
...@@ -2190,6 +2190,7 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions ...@@ -2190,6 +2190,7 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
fgraph=None, # If present the optimized graph. we ignore it. fgraph=None, # If present the optimized graph. we ignore it.
output_keys=None, output_keys=None,
name=None): name=None):
self.mode = mode
self.profile = profile self.profile = profile
optimizer = mode.optimizer optimizer = mode.optimizer
# Handle the case where inputs and/or outputs is a single # Handle the case where inputs and/or outputs is a single
...@@ -2298,18 +2299,15 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions ...@@ -2298,18 +2299,15 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
# the 'no_borrow' outputs are the ones for which that we can't return # the 'no_borrow' outputs are the ones for which that we can't return
# the internal storage pointer. # the internal storage pointer.
no_borrow = [ no_borrow = [output for output, spec in
output izip(fgraph.outputs, outputs + additional_outputs)
for output, spec in izip(fgraph.outputs,
outputs + additional_outputs)
if not spec.borrow] if not spec.borrow]
if no_borrow: if no_borrow:
self.linker = linker.accept( self.linker = linker.accept(
fgraph, fgraph, no_recycling=infer_reuse_pattern(fgraph, no_borrow))
no_recycling=infer_reuse_pattern(fgraph, no_borrow))
else: else:
self.linker = linker.accept(fgraph) self.linker = linker.accept(fgraph)
fgraph.name = name
self.indices = indices self.indices = indices
self.inputs = inputs self.inputs = inputs
self.expanded_inputs = inputs self.expanded_inputs = inputs
...@@ -2318,7 +2316,6 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions ...@@ -2318,7 +2316,6 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
self.return_none = return_none self.return_none = return_none
self.accept_inplace = accept_inplace self.accept_inplace = accept_inplace
self.function_builder = function_builder self.function_builder = function_builder
self.mode = mode
self.on_unused_input = on_unused_input # Used for the pickling/copy self.on_unused_input = on_unused_input # Used for the pickling/copy
self.output_keys = output_keys self.output_keys = output_keys
self.name = name self.name = name
...@@ -2410,6 +2407,7 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions ...@@ -2410,6 +2407,7 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
self.outputs, defaults, self.unpack_single, self.outputs, defaults, self.unpack_single,
self.return_none, self.output_keys, self, self.return_none, self.output_keys, self,
name=self.name) name=self.name)
fn.profile = self.profile
return fn return fn
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论