提交 32ed39fb authored 作者: Frederic's avatar Frederic

Fix test. It wasn't testing what it should.

This was causing a test failure in python 3.3.0, as cmp isn't a built-in function anymore.
上级 e7c738a9
...@@ -1281,7 +1281,7 @@ class TestAdvancedSubtensor(unittest.TestCase): ...@@ -1281,7 +1281,7 @@ class TestAdvancedSubtensor(unittest.TestCase):
z = b[[i, j], :] z = b[[i, j], :]
f1 = theano.function([i, j], z) f1 = theano.function([i, j], z)
cmd = f1(0, 1) == a[[0, 1], :] cmd = f1(0, 1) == a[[0, 1], :]
self.assertTrue(numpy.all(cmp)) self.assertTrue(cmd.all())
aa = rng.uniform(size=(4, 2, 3)) aa = rng.uniform(size=(4, 2, 3))
bb = theano.shared(aa) bb = theano.shared(aa)
...@@ -1289,7 +1289,7 @@ class TestAdvancedSubtensor(unittest.TestCase): ...@@ -1289,7 +1289,7 @@ class TestAdvancedSubtensor(unittest.TestCase):
z = bb[[i, j, k], :, i:k] z = bb[[i, j, k], :, i:k]
f2 = theano.function([i, j, k], z) f2 = theano.function([i, j, k], z)
cmd = f2(0, 1, 2) == aa[[0, 1, 2], :, 0:2] cmd = f2(0, 1, 2) == aa[[0, 1, 2], :, 0:2]
self.assertTrue(numpy.all(cmp)) self.assertTrue(cmd.all())
class TestInferShape(utt.InferShapeTester): class TestInferShape(utt.InferShapeTester):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论