提交 e6e229ef authored 作者: Frederic's avatar Frederic

Use the right method to test for exception to don't catch interrupt.

上级 1dad197f
......@@ -87,16 +87,8 @@ class TestSignalConv2D(unittest.TestCase):
"""
Test that conv2d fails for dimensions other than 2 or 3.
"""
try:
conv.conv2d(T.dtensor4(), T.dtensor3())
self.fail()
except:
pass
try:
conv.conv2d(T.dtensor3(), T.dvector())
self.fail()
except:
pass
self.assertRaises(Exception, conv.conv2d, T.dtensor4(), T.dtensor3())
self.assertRaises(Exception, conv.conv2d, T.dtensor3(), T.dvector())
def test_bug_josh_reported(self):
"""
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论