提交 3be0a29f authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Add test

上级 0b8a9f1e
......@@ -985,6 +985,19 @@ class Test_aliasing_rules(unittest.TestCase):
# objects forming a chain to the underlying data.
class Test_rebuild_strict(unittest.TestCase):
def test1(self):
# Test fix for error reported at
# https://groups.google.com/d/topic/theano-users/BRK0UEB72XA/discussion
w = tensor.imatrix()
x, y = tensor.ivectors('x', 'y')
z = x * y
f = theano.function([w, y], z, givens=[(x, w)], rebuild_strict=False)
z_val = f(numpy.ones((3, 5), dtype='int32'), numpy.arange(5))
assert z_val.ndim == 2
assert numpy.all(z_val == numpy.ones((3, 5)) * numpy.arange(5))
if __name__ == '__main__':
theano.config.mode = 'FAST_COMPILE'
Test_pfunc().test_default_scalar_container()
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论