提交 96b7c725 authored 作者: nouiz's avatar nouiz

Merge pull request #805 from lamblin/fix_py24

Fixes for python 2.4
......@@ -1468,13 +1468,13 @@ class SpSumTester(utt.InferShapeTester):
variable, data = sparse_random_inputs(format,
shape=(10, 10))
z = theano.sparse.sp_sum(*variable, axis=axis)
z = theano.sparse.sp_sum(variable[0], axis=axis)
if axis == None:
assert z.type.broadcastable == ()
else:
assert z.type.broadcastable == (False, )
f = theano.function(variable, self.op(*variable, axis=axis))
f = theano.function(variable, self.op(variable[0], axis=axis))
tested = f(*data)
expected = data[0].todense().sum(axis).ravel()
assert numpy.allclose(tested, expected)
......@@ -1485,7 +1485,7 @@ class SpSumTester(utt.InferShapeTester):
variable, data = sparse_random_inputs(format,
shape=(10, 10))
self._compile_and_check(variable,
[self.op(*variable, axis=axis)],
[self.op(variable[0], axis=axis)],
data,
self.op_class)
......
......@@ -8,7 +8,7 @@ import numpy
from numpy.testing import dec
import theano
from theano.gof.python25 import all
from theano.gof.python25 import all, any
from theano.gof import Variable, Op
from theano import gof, scalar, config
......@@ -673,7 +673,7 @@ class T_mean_dtype(unittest.TestCase):
if sum_dtype in tensor.discrete_dtypes:
assert mean_var.dtype == 'float64', (mean_var.dtype, sum_dtype)
else:
assert mean_var.dtype == sum_dtype, (mean_var.dtype, output_dtype)
assert mean_var.dtype == sum_dtype, (mean_var.dtype, sum_dtype)
# Check that we can take the gradient, when implemented
try:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论