提交 acefaac6 authored 作者: --global's avatar --global

Add test for scan negative sequence taps

上级 3c318186
......@@ -623,6 +623,18 @@ class T_Scan(unittest.TestCase):
rval = theano.function([x], y, updates=updates)(inp)
assert numpy.all(rval == inp[:-1])
def test_using_negative_taps_sequence(self):
def lp(x, x2):
return x
x = tensor.fvector('x')
res, upd = theano.scan(lp,
sequences = dict(input = x, taps = [-2, -1]))
f = theano.function([x], res, updates = upd)
output = f([1, 2, 3, 4, 5])
expected_output = numpy.array([1,2,3], dtype="float32")
utt.assert_allclose(output, expected_output)
def test_connection_pattern(self):
"""Test connection_pattern() in the presence of recurrent outputs
with multiple taps.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论