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

Fix-crash in scan grad when compute_test_value=raise

fix gh-1385
上级 bf549f88
...@@ -1355,10 +1355,15 @@ class Scan(PureOp): ...@@ -1355,10 +1355,15 @@ class Scan(PureOp):
# Note that we do not care about the output of # Note that we do not care about the output of
# this compute gradient. We just care to see if # this compute gradient. We just care to see if
# it is None or not. (i.e. disconnected or not) # it is None or not. (i.e. disconnected or not)
tmp = compute_gradient( try:
inner_out, old = theano.config.compute_test_value
safe_new(inner_out, dtype='float64'), theano.config.compute_test_value = 'off'
ils) tmp = compute_gradient(
inner_out,
safe_new(inner_out, dtype='float64'),
ils)
finally:
theano.config.compute_test_value = old
else: else:
# It should be undefined not disconnected # It should be undefined not disconnected
tmp = ils tmp = ils
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论