From d33ac3e6556815cefcf5f33e641265bd38e327ac Mon Sep 17 00:00:00 2001 From: "Huang, Mingxiao" Date: Tue, 6 Mar 2018 16:41:12 +0800 Subject: [PATCH] update unit test cases --- .travis.yml | 2 +- .../tests/ideep4py_tests/test_convolution2d_py.py | 10 +++++++++- .../tests/ideep4py_tests/test_pooling_2d_py.py | 9 ++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b12cbf51..7220b3bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ script: - cd python - python setup.py install - cd ideep4py/tests - - CHAINER_TEST_GPU_LIMIT=0 pytest -m "not slow and not cudnn" ideep4py_tests + - ENALE_TRAVIS_TEST=1 pytest -s -v . addons: diff --git a/python/ideep4py/tests/ideep4py_tests/test_convolution2d_py.py b/python/ideep4py/tests/ideep4py_tests/test_convolution2d_py.py index 0337dc47..e8eb5ba0 100644 --- a/python/ideep4py/tests/ideep4py_tests/test_convolution2d_py.py +++ b/python/ideep4py/tests/ideep4py_tests/test_convolution2d_py.py @@ -1,3 +1,4 @@ +import os import sys import unittest import numpy @@ -24,11 +25,18 @@ def _set_cover_all(self, x, W): self.pw, d=self.dx)) +if bool(int(os.environ.get('ENALE_TRAVIS_TEST', '0'))): + bs_list = [1, 2, 4, 5, 8, 10, 16, 32, 64, ] +else: + bs_list = [1, 2, 4, 5, 8, 10, 16, 32, 64, 96, 128, 192, 256, 512, ] +print('bs_list: ', bs_list) + + @testing.parameterize(*testing.product({ 'dtype': [numpy.float32, ], 'cover_all': [False, True], 'channel': [1, 2, 4, 8, 10, ], - 'bs': [1, 2, 4, 5, 8, 10, 16, 32, 64, 96, 128, 192, 256, 512, ], + 'bs': bs_list, 'with_bias': [True, ], })) @testing.fix_random() diff --git a/python/ideep4py/tests/ideep4py_tests/test_pooling_2d_py.py b/python/ideep4py/tests/ideep4py_tests/test_pooling_2d_py.py index 5da408c7..bc7ceb79 100644 --- a/python/ideep4py/tests/ideep4py_tests/test_pooling_2d_py.py +++ b/python/ideep4py/tests/ideep4py_tests/test_pooling_2d_py.py @@ -1,3 +1,4 @@ +import os import sys import unittest @@ -16,11 +17,17 @@ print('*** testing directory is missing: %s' % ex) sys.exit(-1) +if bool(int(os.environ.get('ENALE_TRAVIS_TEST', '0'))): + bs_list = [0, 1, 2, 4, 5, 6, 8, 10, 16, 24, 32, 64, ] +else: + bs_list = [0, 1, 2, 4, 5, 6, 8, 10, 16, 24, 32, 64, 96, 128, 196, 256, ] +print('bs_list: ', bs_list) + @testing.parameterize(*testing.product({ 'dtype': [numpy.float32], 'channel': [1, 2, 4, 8, 10, 16, 24, 32, 64, ], - 'bs': [0, 1, 2, 4, 5, 6, 8, 10, 16, 24, 32, 64, 96, 128, 196, 256, ], + 'bs': bs_list, 'stride': [2, ], })) class TestPooling2DPyF32(unittest.TestCase):