提交 9c22f61e authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Reverse version bump and skip case unsupported by old numpy

上级 d87b74a2
......@@ -30,7 +30,7 @@ addons:
- dvipng
install:
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then conda create --yes -q -n pyenv mkl python=2.6 numpy=1.9.1 scipy=0.14.0 nose=1.3.0 pip flake8=2.3 six=1.9.0 pep8=1.6.2 pyflakes=0.8.1 sphinx; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then conda create --yes -q -n pyenv mkl python=2.6 numpy=1.7.1 scipy=0.11 nose=1.3.0 pip flake8=2.3 six=1.9.0 pep8=1.6.2 pyflakes=0.8.1 sphinx; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then conda create --yes -q -n pyenv mkl python=3.3 numpy=1.9.1 scipy=0.14.0 nose=1.3.4 pip flake8=2.3 six=1.9.0 pep8=1.6.2 pyflakes=0.8.1 sphinx; fi
- source activate pyenv
# pydot 1.2 broke support of python 2.6. They won't try to maintain it.
......
......@@ -342,18 +342,24 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin):
def test_ellipsis(self):
numpy_n = numpy.arange(24, dtype=self.dtype).reshape((2, 3, 4))
n = self.shared(numpy_n)
for length, op_type, slice_ in [
(0, self.sub, numpy.index_exp[...]),
(1, self.sub, numpy.index_exp[..., 1]),
(1, self.sub, numpy.index_exp[1, ...]),
(1, self.sub, numpy.index_exp[..., 1, 2, 3]),
(1, self.sub, numpy.index_exp[1, ..., 2, 3]),
(1, self.sub, numpy.index_exp[1, 2, 3, ...]),
(3, DimShuffle, numpy.index_exp[..., [0, 2, 3]]),
(1, DimShuffle,
numpy.index_exp[numpy.newaxis, ...]),
test_cases = [
(0, self.sub, numpy.index_exp[...]),
(1, self.sub, numpy.index_exp[..., 1]),
(1, self.sub, numpy.index_exp[1, ...]),
(1, self.sub, numpy.index_exp[..., 1, 2, 3]),
(1, self.sub, numpy.index_exp[1, ..., 2, 3]),
(1, self.sub, numpy.index_exp[1, 2, 3, ...]),
(3, DimShuffle, numpy.index_exp[..., [0, 2, 3]]),
(1, DimShuffle,
numpy.index_exp[numpy.newaxis, ...])]
# The following test case is not supported by numpy before 1.9
numpy_version = [int(v) for v in numpy.version.version.split('.')[0:2]]
if numpy_version >= [1, 9]:
test_cases.append(
(1, AdvancedSubtensor,
numpy.index_exp[..., numpy.newaxis, [1, 2]])]:
numpy.index_exp[..., numpy.newaxis, [1, 2]]))
for length, op_type, slice_ in test_cases:
numpy_tval = numpy_n[slice_]
t = n[slice_]
self.assertTrue(isinstance(t.owner.op, op_type))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论