提交 c82f6e51 authored 作者: Pascal Lamblin's avatar Pascal Lamblin 提交者: GitHub

Merge pull request #5850 from nouiz/test_value

Disable compute_test_value during Theano optimization phase. This giv…
...@@ -1799,14 +1799,15 @@ def orig_function(inputs, outputs, mode=None, accept_inplace=False, ...@@ -1799,14 +1799,15 @@ def orig_function(inputs, outputs, mode=None, accept_inplace=False,
fn = None fn = None
try: try:
Maker = getattr(mode, 'function_maker', FunctionMaker) Maker = getattr(mode, 'function_maker', FunctionMaker)
fn = Maker(inputs, m = Maker(inputs,
outputs, outputs,
mode, mode,
accept_inplace=accept_inplace, accept_inplace=accept_inplace,
profile=profile, profile=profile,
on_unused_input=on_unused_input, on_unused_input=on_unused_input,
output_keys=output_keys).create( output_keys=output_keys)
defaults) with theano.configparser.change_flags(compute_test_value="off"):
fn = m.create(defaults)
finally: finally:
t2 = time.time() t2 = time.time()
if fn and profile: if fn and profile:
......
...@@ -1674,7 +1674,7 @@ def verify_grad(fun, pt, n_tests=2, rng=None, eps=None, ...@@ -1674,7 +1674,7 @@ def verify_grad(fun, pt, n_tests=2, rng=None, eps=None,
return np.array(plain, o_output.dtype) return np.array(plain, o_output.dtype)
return plain return plain
t_r = shared(random_projection()) t_r = shared(random_projection(), borrow=True)
t_r.name = 'random_projection' t_r.name = 'random_projection'
# random projection of o onto t_r # random projection of o onto t_r
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论