提交 70149651 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

fixed bug introduced by the new implementation of safe_new

Specifically for initial states, they should always stay variables, and not be constants !
上级 207e29e8
......@@ -585,6 +585,10 @@ def scan( fn
actual_arg = init_out['initial']
arg = safe_new(init_out['initial'])
if isinstance(arg, tensor.Constant):
# safe new returns a clone of the constants, but that is not
# what we need for initial states
arg = arg.type()
# Try to transfer test_value to the new variable
if config.compute_test_value != 'off':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论