Skip to content

Commit

Permalink
update unit test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxiaoh committed Mar 6, 2018
1 parent b33ffca commit d33ac3e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 9 additions & 1 deletion python/ideep4py/tests/ideep4py_tests/test_convolution2d_py.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import sys
import unittest
import numpy
Expand All @@ -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()
Expand Down
9 changes: 8 additions & 1 deletion python/ideep4py/tests/ideep4py_tests/test_pooling_2d_py.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import sys
import unittest

Expand All @@ -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):
Expand Down

0 comments on commit d33ac3e

Please sign in to comment.