[theano] 02/03: Make tests work with older nose-parameterized.
Rebecca Palmer
rnpalmer-guest at moszumanska.debian.org
Fri Sep 22 19:16:28 UTC 2017
This is an automated email from the git hooks/post-receive script.
rnpalmer-guest pushed a commit to branch master
in repository theano.
commit 7971c150c71cdee864bf464742c4504bf9b535bf
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date: Fri Sep 22 19:23:30 2017 +0100
Make tests work with older nose-parameterized.
---
debian/changelog | 1 +
debian/patches/old-nose-parameterized.patch | 112 ++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 114 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 89b6ed5..5f354f6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,7 @@ theano (0.9.0-1) UNRELEASED; urgency=medium
* Build-depend on python3-sphinx-rtd-theme.
* Use the version in doc->source links,
not a (usually non-existent) git commit number.
+ * Make tests work with older nose-parameterized.
-- Rebecca N. Palmer <rebecca_palmer at zoho.com> Mon, 18 Sep 2017 22:15:10 +0100
diff --git a/debian/patches/old-nose-parameterized.patch b/debian/patches/old-nose-parameterized.patch
new file mode 100644
index 0000000..c164499
--- /dev/null
+++ b/debian/patches/old-nose-parameterized.patch
@@ -0,0 +1,112 @@
+Description: Don't use utt.custom_name_func in tests
+
+Debian's nose-parameterized is too old to support custom name functions
+in expand().
+
+Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+Forwarded: not-needed
+
+--- theano-0.9.0.orig/theano/gpuarray/tests/test_dnn.py
++++ theano-0.9.0/theano/gpuarray/tests/test_dnn.py
+@@ -633,8 +633,7 @@ class TestDnnInferShapes(utt.InferShapeT
+ conv_modes),
+ product(SUPPORTED_DNN_CONV_ALGO_FWD[1:],
+ [border_modes[0]],
+- [conv_modes[0]])),
+- testcase_func_name=utt.custom_name_func)
++ [conv_modes[0]])))
+ def test_conv(self, algo, border_mode, conv_mode):
+ self._test_conv(T.tensor4('img'),
+ T.tensor4('kerns'),
+@@ -646,7 +645,7 @@ class TestDnnInferShapes(utt.InferShapeT
+ [(1, 1), (2, 2)],
+ algo)
+
+- @parameterized.expand(product(border_modes, conv_modes), utt.custom_name_func)
++ @parameterized.expand(product(border_modes, conv_modes))
+ def test_conv3d_none(self, border_mode, conv_mode):
+ self._test_conv(T.tensor5('img'),
+ T.tensor5('kerns'),
+@@ -695,7 +694,7 @@ class TestDnnInferShapes(utt.InferShapeT
+ dnn.GpuDnnConvGradW
+ )
+
+- @parameterized.expand(product(border_modes, conv_modes), utt.custom_name_func)
++ @parameterized.expand(product(border_modes, conv_modes))
+ def test_conv_gradw(self, border_mode, conv_mode):
+ self._test_conv_gradw(T.tensor4('img'),
+ T.tensor4('topgrad'),
+--- theano-0.9.0.orig/theano/sandbox/cuda/tests/test_dnn.py
++++ theano-0.9.0/theano/sandbox/cuda/tests/test_dnn.py
+@@ -1297,7 +1297,7 @@ class TestDnnInferShapes(utt.InferShapeT
+ border_modes = ['valid', 'full', 'half']
+ conv_modes = ['conv', 'cross']
+
+- @parameterized.expand(product(border_modes, conv_modes), utt.custom_name_func)
++ @parameterized.expand(product(border_modes, conv_modes))
+ def test_conv_gradw(self, border_mode, conv_mode):
+ self._test_conv_gradw(T.ftensor4('img'),
+ T.ftensor4('topgrad'),
+@@ -1345,7 +1345,7 @@ class TestDnnInferShapes(utt.InferShapeT
+ dnn.GpuDnnConv3dGradW
+ )
+
+- @parameterized.expand(product(border_modes, conv_modes), utt.custom_name_func)
++ @parameterized.expand(product(border_modes, conv_modes))
+ def test_conv3d_gradw(self, border_mode, conv_mode):
+ self._test_conv3d_gradw(T.ftensor5('img'),
+ T.ftensor5('topgrad'),
+--- theano-0.9.0.orig/theano/sandbox/cuda/tests/test_tensor_op.py
++++ theano-0.9.0/theano/sandbox/cuda/tests/test_tensor_op.py
+@@ -141,7 +141,7 @@ def test_get_diagonal_subtensor_view():
+ test_conv3d2d.test_get_diagonal_subtensor_view(wrap=cuda.CudaNdarray)
+
+
+- at parameterized.expand(('valid', 'full'), utt.custom_name_func)
++ at parameterized.expand(('valid', 'full'))
+ def test_conv3d(border_mode):
+ test_conv3d2d.check_conv3d(border_mode=border_mode,
+ mode=mode_with_gpu,
+--- theano-0.9.0.orig/theano/tensor/nnet/tests/test_conv3d2d.py
++++ theano-0.9.0/theano/tensor/nnet/tests/test_conv3d2d.py
+@@ -104,7 +104,7 @@ def check_diagonal_subtensor_view_traces
+ fn, ops_to_check=(DiagonalSubtensor, IncDiagonalSubtensor))
+
+
+- at parameterized.expand(('valid', 'full', 'half'), utt.custom_name_func)
++ at parameterized.expand(('valid', 'full', 'half'))
+ def test_conv3d(border_mode):
+ check_conv3d(border_mode=border_mode,
+ mode=mode_without_gpu,
+--- theano-0.9.0.orig/theano/tensor/signal/tests/test_pool.py
++++ theano-0.9.0/theano/tensor/signal/tests/test_pool.py
+@@ -595,8 +595,7 @@ class TestDownsampleFactorMax(utt.InferS
+ ['max',
+ 'sum',
+ 'average_inc_pad',
+- 'average_exc_pad']),
+- testcase_func_name=utt.custom_name_func)
++ 'average_exc_pad']))
+ def test_DownsampleFactorMax_grad_stride(self, example, ignore_border, mode):
+ # checks the gradient for the case that stride is used
+ rng = numpy.random.RandomState(utt.fetch_seed())
+@@ -686,8 +685,7 @@ class TestDownsampleFactorMax(utt.InferS
+ utt.verify_grad(mp, [imval, grad_val], rng=rng)
+
+ @parameterized.expand(product(pool_grad_stride_examples,
+- [True, False]),
+- testcase_func_name=utt.custom_name_func)
++ [True, False]))
+ def test_DownsampleFactorMaxGrad_grad_stride(self, example, ignore_border):
+ # checks the gradient of the gradient for
+ # the case that stride is used
+@@ -717,8 +715,7 @@ class TestDownsampleFactorMax(utt.InferS
+ [True, False],
+ ['sum',
+ 'average_inc_pad',
+- 'average_exc_pad']),
+- testcase_func_name=utt.custom_name_func)
++ 'average_exc_pad']))
+ def test_AveragePoolGrad_grad_stride(self, example, ignore_border, mode):
+ # checks the gradient of the gradient for
+ # the case that stride is used
diff --git a/debian/patches/series b/debian/patches/series
index 42da257..8a452d5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
disable-overly-environment-dependent-test.patch
strip-docs.patch
linkcode.patch
+old-nose-parameterized.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/theano.git
More information about the debian-science-commits
mailing list