提交 26dddb57 authored 作者: James Bergstra's avatar James Bergstra

ENH: function_module.std_graph feature registry

上级 3c052bff
......@@ -15,7 +15,6 @@ import numpy
import theano
from theano import gof
from theano.gof.python25 import partial
from theano.gradient import check_for_bad_grad
import mode as mode_module
from io import In, SymbolicInput, SymbolicInputKit, SymbolicOutput
......@@ -144,9 +143,14 @@ def std_fgraph(input_specs, output_specs, accept_inplace = False):
fgraph.extend(Supervisor(input for spec, input in zip(input_specs, inputs) if not (spec.mutable or (hasattr(fgraph, 'destroyers') and fgraph.destroyers(input)))))
# If named nodes are replaced, keep the name
fgraph.extend(gof.toolbox.PreserveNames())
for feature in std_fgraph.features:
fgraph.extend(feature())
return fgraph, map(SymbolicOutput, updates)
std_fgraph.features = [gof.toolbox.PreserveNames]
class AliasedMemoryError(Exception):
"""Memory is aliased that should not be"""
pass
......@@ -1337,8 +1341,6 @@ def orig_function(inputs, outputs, mode=None, accept_inplace=False,
t1 = time.time()
mode = mode_module.get_mode(mode)
check_for_bad_grad(outputs)
inputs = map(convert_function_input, inputs)
if outputs is not None:
if isinstance(outputs, (list, tuple)):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论