提交 088ecf40 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

same as ifelse to convert args into theano variables

I used to call as_tensor_variable which is not ok for sparse or random generators
上级 2c227364
......@@ -625,12 +625,8 @@ def scan(fn,
scan_inputs = []
for arg in [actual_n_steps] + _scan_inputs:
try:
if not isinstance(arg, gof.Variable):
arg = tensor.as_tensor_variable(arg)
except TypeError:
# This happens for Random States for e.g. but it is a good way
# to make sure no input is a cuda ndarrays
pass
scan_inputs += [arg]
scan_outs = local_op(*scan_inputs)
if type(scan_outs) not in (list, tuple):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论