sandeep-krishnamurthy commented on a change in pull request #13362: Add NHWC
layout support to Pooling (cuDNN only)
URL: https://github.com/apache/incubator-mxnet/pull/13362#discussion_r239272144
##########
File path: tests/python/gpu/test_operator_gpu.py
##########
@@ -608,6 +608,52 @@ def test_convolution_versions():
@with_seed()
+def test_pooling_with_convention():
+ # While the float32 and float64 output is reliably consistent, float16
departs occasionally.
+ # We compare cpu and gpu results only within a given precision.
+ for data_type in [np.float64, np.float32, np.float16]:
+ ctx_list = [{'ctx': mx.gpu(0), 'pool_data': (2, 2, 10, 10),
'type_dict': {'pool_data': data_type}},
+ {'ctx': mx.cpu(0), 'pool_data': (2, 2, 10, 10),
'type_dict': {'pool_data': data_type}}]
+ sym = mx.sym.Pooling(kernel=(3,3), pool_type='max',
pooling_convention='valid', name='pool')
+ check_consistency(sym, ctx_list)
+
+ sym = mx.sym.Pooling(kernel=(3,3), pool_type='max',
pooling_convention='full', name='pool')
+ check_consistency(sym, ctx_list)
+
+ sym = mx.sym.Pooling(kernel=(300,300), pool_type='max',
global_pool=True, name='pool')
+ check_consistency(sym, ctx_list)
+
+
+@with_seed()
+@assert_raises_cudnn_not_satisfied(min_version='7.0.1')
Review comment:
should it rather skip this test if cudnn version is < 7.0.1 ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services