提交 74b59451 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Skip tests of average_exc_pad with cudnn v3

上级 7b206fb7
...@@ -235,8 +235,14 @@ def test_pooling(): ...@@ -235,8 +235,14 @@ def test_pooling():
if not cuda.dnn.dnn_available(): if not cuda.dnn.dnn_available():
raise SkipTest(cuda.dnn.dnn_available.msg) raise SkipTest(cuda.dnn.dnn_available.msg)
# 'average_exc_pad' is disabled for versions < 4004
if cuda.dnn.version() < (4004, 4004):
modes = ('max', 'average_inc_pad')
else:
modes = ('max', 'average_inc_pad', 'average_exc_pad')
x = T.ftensor4() x = T.ftensor4()
for mode, pad in product(('max', 'average_inc_pad', 'average_exc_pad'), for mode, pad in product(modes,
((0, 0), (1, 0), (1, 0), (2, 3), (3, 2))): ((0, 0), (1, 0), (1, 0), (2, 3), (3, 2))):
if mode == 'max': if mode == 'max':
func = T.max func = T.max
...@@ -346,9 +352,15 @@ def test_pooling3d(): ...@@ -346,9 +352,15 @@ def test_pooling3d():
if not cuda.dnn.dnn_available() or cuda.dnn.version() < (3000, 3000): if not cuda.dnn.dnn_available() or cuda.dnn.version() < (3000, 3000):
raise SkipTest(cuda.dnn.dnn_available.msg) raise SkipTest(cuda.dnn.dnn_available.msg)
# 'average_exc_pad' is disabled for versions < 4004
if cuda.dnn.version() < (4004, 4004):
modes = ('max', 'average_inc_pad')
else:
modes = ('max', 'average_inc_pad', 'average_exc_pad')
x = T.TensorType(broadcastable=(False, False, False, False, False), x = T.TensorType(broadcastable=(False, False, False, False, False),
dtype='float32')() dtype='float32')()
for mode, pad in product(('max', 'average_inc_pad', 'average_exc_pad'), for mode, pad in product(modes,
((0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1), ((0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1),
(2, 3, 2), (3, 2, 2), (2, 2, 3))): (2, 3, 2), (3, 2, 2), (2, 2, 3))):
if mode == 'max': if mode == 'max':
...@@ -940,10 +952,17 @@ class TestDnnInferShapes(utt.InferShapeTester): ...@@ -940,10 +952,17 @@ class TestDnnInferShapes(utt.InferShapeTester):
numpy.random.rand(2, 3, 4, 5), numpy.random.rand(2, 3, 4, 5),
dtype='float32' dtype='float32'
) )
# 'average_exc_pad' is disabled for versions < 4004
if cuda.dnn.version() < (4004, 4004):
modes = ['max', 'average_inc_pad']
else:
modes = ['max', 'average_inc_pad', 'average_exc_pad']
for params in product( for params in product(
[(1, 1), (2, 2), (3, 3)], [(1, 1), (2, 2), (3, 3)],
[(1, 1), (2, 2), (3, 3)], [(1, 1), (2, 2), (3, 3)],
['max', 'average_inc_pad', 'average_exc_pad'] modes
): ):
desc = dnn.GpuDnnPoolDesc( desc = dnn.GpuDnnPoolDesc(
ws=params[0], ws=params[0],
......
...@@ -166,8 +166,14 @@ def test_pooling(): ...@@ -166,8 +166,14 @@ def test_pooling():
if not dnn.dnn_available(test_ctx_name): if not dnn.dnn_available(test_ctx_name):
raise SkipTest(dnn.dnn_available.msg) raise SkipTest(dnn.dnn_available.msg)
# 'average_exc_pad' is disabled for versions < 4004
if dnn.version() < 4004:
modes = ('max', 'average_inc_pad')
else:
modes = ('max', 'average_inc_pad', 'average_exc_pad')
x = T.ftensor4() x = T.ftensor4()
for mode, pad in product(('max', 'average_inc_pad', 'average_exc_pad'), for mode, pad in product(modes,
((0, 0), (1, 0), (1, 0), (2, 3), (3, 2))): ((0, 0), (1, 0), (1, 0), (2, 3), (3, 2))):
if mode == 'max': if mode == 'max':
func = T.max func = T.max
...@@ -506,10 +512,17 @@ class TestDnnInferShapes(utt.InferShapeTester): ...@@ -506,10 +512,17 @@ class TestDnnInferShapes(utt.InferShapeTester):
numpy.random.rand(2, 3, 4, 5), numpy.random.rand(2, 3, 4, 5),
dtype='float32' dtype='float32'
) )
# 'average_exc_pad' is disabled for versions < 4004
if dnn.version() < 4004:
modes = ['max', 'average_inc_pad']
else:
modes = ['max', 'average_inc_pad', 'average_exc_pad']
for params in product( for params in product(
[(1, 1), (2, 2), (3, 3)], [(1, 1), (2, 2), (3, 3)],
[(1, 1), (2, 2), (3, 3)], [(1, 1), (2, 2), (3, 3)],
['max', 'average_inc_pad', 'average_exc_pad'] modes
): ):
desc = dnn.GpuDnnPoolDesc( desc = dnn.GpuDnnPoolDesc(
ws=params[0], ws=params[0],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论