提交 448322bc authored 作者: rman@rpad's avatar rman@rpad

bug in test for scan

上级 9c9d5036
...@@ -437,6 +437,9 @@ def scan(fn, sequences=[], info_outputs=[], non_sequences=[], ...@@ -437,6 +437,9 @@ def scan(fn, sequences=[], info_outputs=[], non_sequences=[],
# Call the object on the input sequences, initial values for outs, # Call the object on the input sequences, initial values for outs,
# and non sequences # and non sequences
for seq in seqs :
if not seq.get('input', None):
raiseValue('All input sequences should provide')
unwrapped_seqs = [ seq.get('input',theano.tensor.as_tensor(0)) for seq in seqs ] unwrapped_seqs = [ seq.get('input',theano.tensor.as_tensor(0)) for seq in seqs ]
unwrapped_outs = [ out.get('initial',theano.tensor.as_tensor(0)) for out in info_outs ] unwrapped_outs = [ out.get('initial',theano.tensor.as_tensor(0)) for out in info_outs ]
values = local_op( *( [theano.tensor.as_tensor(n_steps)] \ values = local_op( *( [theano.tensor.as_tensor(n_steps)] \
...@@ -782,7 +785,7 @@ class Scan(theano.Op): ...@@ -782,7 +785,7 @@ class Scan(theano.Op):
y[j][i] = something[j] y[j][i] = something[j]
except : except :
y[j] = numpy.empty( (n_steps,)+something[j].shape , dtype = y[j] = numpy.empty( (n_steps,)+something[j].shape , dtype =
something[j].dtype) something[j].dtype)
y[j][i] = something[j] y[j][i] = something[j]
elif self.stored_steps_output[j] == 1: elif self.stored_steps_output[j] == 1:
try: try:
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论