提交 1bf6c2ac authored 作者: Frederic's avatar Frederic

small fix to tests.

上级 ba2610d4
...@@ -1890,7 +1890,8 @@ class MultinomialTester(utt.InferShapeTester): ...@@ -1890,7 +1890,8 @@ class MultinomialTester(utt.InferShapeTester):
_p = sp.csr_matrix(numpy.asarray([[0.0, 0.5, 0.0, 0.5], _p = sp.csr_matrix(numpy.asarray([[0.0, 0.5, 0.0, 0.5],
[0.1, 0.2, 0.3, 0.4], [0.1, 0.2, 0.3, 0.4],
[0.0, 1.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0],
[0.3, 0.3, 0.0, 0.4]])) [0.3, 0.3, 0.0, 0.4]],
dtype=config.floatX))
def setUp(self): def setUp(self):
super(MultinomialTester, self).setUp() super(MultinomialTester, self).setUp()
......
...@@ -429,9 +429,9 @@ class test_CAReduce(unittest_tools.InferShapeTester): ...@@ -429,9 +429,9 @@ class test_CAReduce(unittest_tools.InferShapeTester):
x = TensorType(dtype, [(entry == 1) for entry in xsh])('x') x = TensorType(dtype, [(entry == 1) for entry in xsh])('x')
if tosum is None: if tosum is None:
tosum = range(len(xsh)) tosum = range(len(xsh))
xv = numpy.asarray(numpy.random.rand(*xsh)) xv = numpy.asarray(numpy.random.rand(*xsh), dtype=dtype)
self._compile_and_check([x], self._compile_and_check([x],
[CAReduce(add, axis=tosum)(x)], [CAReduce(scalar.add, axis=tosum)(x)],
[xv], CAReduce, ["local_cut_useless_reduce"]) [xv], CAReduce, ["local_cut_useless_reduce"])
...@@ -811,10 +811,10 @@ class TestElemwise(unittest_tools.InferShapeTester): ...@@ -811,10 +811,10 @@ class TestElemwise(unittest_tools.InferShapeTester):
dtype = theano.config.floatX dtype = theano.config.floatX
t_left = TensorType(dtype, [(entry == 1) for entry in s_left])() t_left = TensorType(dtype, [(entry == 1) for entry in s_left])()
t_right = TensorType(dtype, [(entry == 1) for entry in s_right])() t_right = TensorType(dtype, [(entry == 1) for entry in s_right])()
t_left_val = numpy.zeros(s_left) t_left_val = numpy.zeros(s_left, dtype=dtype)
t_right_val = numpy.zeros(s_right) t_right_val = numpy.zeros(s_right, dtype=dtype)
self._compile_and_check([t_left, t_right], self._compile_and_check([t_left, t_right],
[Elemwise(add)(t_left, t_right)], [Elemwise(scalar.add)(t_left, t_right)],
[t_left_val, t_right_val], Elemwise) [t_left_val, t_right_val], Elemwise)
......
...@@ -3442,7 +3442,7 @@ class TestMakeVector(utt.InferShapeTester): ...@@ -3442,7 +3442,7 @@ class TestMakeVector(utt.InferShapeTester):
def setUp(self): def setUp(self):
super(TestMakeVector, self).setUp() super(TestMakeVector, self).setUp()
def test_make_vector(): def test_make_vector(self):
b = T.bscalar() b = T.bscalar()
i = T.iscalar() i = T.iscalar()
d = T.dscalar() d = T.dscalar()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论