提交 8bde3d2f authored 作者: David Warde-Farley's avatar David Warde-Farley

STY: quick pep8 fix to PR #122.

上级 ad987df5
...@@ -222,6 +222,7 @@ class TestConv2D(unittest.TestCase): ...@@ -222,6 +222,7 @@ class TestConv2D(unittest.TestCase):
""" """
self.assertRaises(AssertionError, self.validate, (3,2,8,8), (4,3,5,5), self.assertRaises(AssertionError, self.validate, (3,2,8,8), (4,3,5,5),
'valid') 'valid')
def test_invalid_input_shape(self): def test_invalid_input_shape(self):
""" """
Tests that when the shape gived at build time is not the same as Tests that when the shape gived at build time is not the same as
...@@ -231,44 +232,52 @@ class TestConv2D(unittest.TestCase): ...@@ -231,44 +232,52 @@ class TestConv2D(unittest.TestCase):
for unroll_kern in [None, 2, 4]: for unroll_kern in [None, 2, 4]:
for unroll_patch in [None, True, False]: for unroll_patch in [None, True, False]:
for mode in ['valid', 'full']: for mode in ['valid', 'full']:
self.assertRaises(ValueError, self.validate, (3,2,8,8), (4,2,5,5), self.assertRaises(ValueError, self.validate,
mode, N_image_shape = (2,2,8,8), (3, 2, 8, 8), (4, 2, 5, 5),
mode, N_image_shape=(2, 2, 8, 8),
unroll_batch=unroll_batch, unroll_batch=unroll_batch,
unroll_kern=unroll_kern, unroll_kern=unroll_kern,
unroll_patch=unroll_patch) unroll_patch=unroll_patch)
self.assertRaises(ValueError, self.validate, (3,2,8,8), (4,2,5,5), self.assertRaises(ValueError, self.validate,
mode, N_image_shape = (3,1,8,8), (3, 2, 8, 8), (4, 2, 5, 5),
mode, N_image_shape=(3, 1, 8, 8),
unroll_batch=unroll_batch, unroll_batch=unroll_batch,
unroll_kern=unroll_kern, unroll_kern=unroll_kern,
unroll_patch=unroll_patch) unroll_patch=unroll_patch)
self.assertRaises(ValueError, self.validate, (3,2,8,8), (4,2,5,5), self.assertRaises(ValueError, self.validate,
mode, N_image_shape = (3,2,7,8), (3, 2, 8, 8), (4, 2, 5, 5),
mode, N_image_shape=(3, 2, 7, 8),
unroll_batch=unroll_batch, unroll_batch=unroll_batch,
unroll_kern=unroll_kern, unroll_kern=unroll_kern,
unroll_patch=unroll_patch) unroll_patch=unroll_patch)
self.assertRaises(ValueError, self.validate, (3,2,8,8), (4,2,5,5), self.assertRaises(ValueError, self.validate,
mode, N_image_shape = (3,2,8,7), (3, 2, 8, 8), (4, 2, 5, 5),
mode, N_image_shape=(3, 2, 8, 7),
unroll_batch=unroll_batch, unroll_batch=unroll_batch,
unroll_kern=unroll_kern, unroll_kern=unroll_kern,
unroll_patch=unroll_patch) unroll_patch=unroll_patch)
self.assertRaises(ValueError, self.validate, (3,2,8,8), (4,2,5,5), self.assertRaises(ValueError, self.validate,
mode, N_filter_shape = (3,2,5,5), (3, 2, 8, 8), (4, 2, 5, 5),
mode, N_filter_shape=(3, 2, 5, 5),
unroll_batch=unroll_batch, unroll_batch=unroll_batch,
unroll_kern=unroll_kern, unroll_kern=unroll_kern,
unroll_patch=unroll_patch) unroll_patch=unroll_patch)
self.assertRaises(ValueError, self.validate, (3,2,8,8), (4,2,5,5), self.assertRaises(ValueError, self.validate,
mode, N_filter_shape = (4,1,5,5), (3, 2, 8, 8), (4, 2, 5, 5),
mode, N_filter_shape=(4, 1, 5, 5),
unroll_batch=unroll_batch, unroll_batch=unroll_batch,
unroll_kern=unroll_kern, unroll_kern=unroll_kern,
unroll_patch=unroll_patch) unroll_patch=unroll_patch)
self.assertRaises(ValueError, self.validate, (3,2,8,8), (4,2,5,5), self.assertRaises(ValueError, self.validate,
mode, N_filter_shape = (4,2,6,5), (3, 2, 8, 8), (4, 2, 5, 5),
mode, N_filter_shape=(4, 2, 6, 5),
unroll_batch=unroll_batch, unroll_batch=unroll_batch,
unroll_kern=unroll_kern, unroll_kern=unroll_kern,
unroll_patch=unroll_patch) unroll_patch=unroll_patch)
self.assertRaises(ValueError, self.validate, (3,2,8,8), (4,2,5,5), self.assertRaises(ValueError, self.validate,
mode, N_filter_shape = (4,2,5,6), (3, 2, 8, 8), (4, 2, 5, 5),
mode, N_filter_shape=(4, 2, 5, 6),
unroll_batch=unroll_batch, unroll_batch=unroll_batch,
unroll_kern=unroll_kern, unroll_kern=unroll_kern,
unroll_patch=unroll_patch) unroll_patch=unroll_patch)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论