提交 a0eb7306 authored 作者: Frederic's avatar Frederic

Enable, fix power tests.

上级 d084cecf
...@@ -6985,7 +6985,7 @@ class T_swapaxes(unittest.TestCase): ...@@ -6985,7 +6985,7 @@ class T_swapaxes(unittest.TestCase):
assert numpy.allclose(n_s, t_s) assert numpy.allclose(n_s, t_s)
class T_Power(): class T_Power(unittest.TestCase):
def test_numpy_compare(self): def test_numpy_compare(self):
rng = numpy.random.RandomState(utt.fetch_seed()) rng = numpy.random.RandomState(utt.fetch_seed())
A = tensor.matrix("A", dtype=theano.config.floatX) A = tensor.matrix("A", dtype=theano.config.floatX)
...@@ -6998,18 +6998,18 @@ class T_Power(): ...@@ -6998,18 +6998,18 @@ class T_Power():
assert numpy.allclose(n_p, t_p) assert numpy.allclose(n_p, t_p)
def test_multiple_power(self): def test_multiple_power(self):
x = tensor.matrix() x = tensor.vector()
y = [1, 2, 3] y = [1, 2, 3]
z = power(x, y) z = power(x, y)
f = function([x], z) f = function([x], z)
assert allclose(f([1, 2, 3]), [1, 4, 27]) assert numpy.allclose(f([1, 2, 3]), [1, 4, 27])
def test_wrong_shape(self): def test_wrong_shape(self):
x = tensor.matrix() x = tensor.vector()
y = [1, 2, 3] y = [1, 2, 3]
z = power(x, y) z = power(x, y)
f = function([x], z) f = function([x], z)
self.assertRaise(ValueError, f, [1, 2, 3, 4]) self.assertRaises(ValueError, f, [1, 2, 3, 4])
class T_Choose(utt.InferShapeTester): class T_Choose(utt.InferShapeTester):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论