提交 5033994d authored 作者: Razvan Pascanu's avatar Razvan Pascanu

changed the comment on the test

I think Fred is right, it wasn't about having a subtensor on the second dimension.
上级 8908b957
......@@ -287,8 +287,9 @@ class T_Scan(unittest.TestCase):
def test_subtensor_multiple_slices(self):
# This addresses a bug reported by Matthias Zoehrer
# the bug happens when you index on the second dimension,
# case in which the scan save mem optimization fails
# the bug happens when you have multiple subtensors on the output of
# scan (the bug requires the reshape to be produced, and it has
# which has something to do with how the subtensors overlap
def f_pow2(x_tm1):
return 2 * x_tm1
......@@ -302,8 +303,9 @@ class T_Scan(unittest.TestCase):
truncate_gradient=-1,
go_backwards=False)
nw_shape = tensor.ivector('nw_shape')
my_f = theano.function([state, n_steps,nw_shape],
[tensor.reshape(output,nw_shape,ndim=3)[:-2],
# Note that the output is reshaped to 3 dimensional tensor, and
my_f = theano.function([state, n_steps, nw_shape],
[tensor.reshape(output, nw_shape, ndim=3)[:-2],
output[:-4]],
updates=updates,
allow_input_downcast=True)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论