You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/12 17:20:32 UTC

[GitHub] zheng-da commented on a change in pull request #11047: [MXNET-33] Enhance mkldnn pooling to support full convention

zheng-da commented on a change in pull request #11047: [MXNET-33] Enhance mkldnn pooling to support full convention
URL: https://github.com/apache/incubator-mxnet/pull/11047#discussion_r194822168
 
 

 ##########
 File path: tests/python/gpu/test_operator_gpu.py
 ##########
 @@ -920,6 +920,35 @@ def test_3d_pooling(pool_type, p_value=2):
     test_3d_pooling('lp', p_value=3)
 
 
+@with_seed()
+def test_pooling_full_2d():
+    def test_pooling_full_2d_type(pool_type):
+        data = (2, 2, 10, 10)
+        kernel = (4, 5)
+        pad = (1, 2)
+        stride = (3, 4)
+
+        convention = 'full'
+        ctx_list = []
+        sym_list = []
+
+        # o_h = ceil((10 + 1 + 1 - 4) / 3) + 1 = 4
+        # o_w = ceil((10 + 2 + 2 - 5) / 4) + 1 = 4
+        ctx_list.append({'ctx': mx.cpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
+        sym_list.append(mx.sym.Pooling(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
+                                       pooling_convention=convention, global_pool=True, name='pool'))
+
+        ctx_list.append({'ctx': mx.gpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
+        sym_list.append(mx.sym.Pooling(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
+                                       pooling_convention=convention, global_pool=True, name='pool'))
 
 Review comment:
   it doesn't seem you test your code. Once global_pool is true, all paddings are set to 0.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services