TaoLv commented on a change in pull request #10000: fix average pooling kernel 
size assignment error
URL: https://github.com/apache/incubator-mxnet/pull/10000#discussion_r172729362
 
 

 ##########
 File path: tests/python/gpu/test_operator_gpu.py
 ##########
 @@ -904,86 +904,87 @@ def test_1d_pooling(pool_type):
         kernel = (4,)
         pad = (2,)
         stride = (2,)
-    
+
         ctx_list = []
         sym_list = []
-    
+
         pooling_convention = 'valid'
-    
+
         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,
+        sym_list.append(mx.sym.Pooling(pad=pad, stride=stride, 
pool_type=pool_type,
                                        pooling_convention=pooling_convention, 
global_pool=True, name='pool'))
-    
+
         ctx_list.append({'ctx': mx.cpu(0), 'pool_data': data, 'type_dict': 
{'pool_data': np.float32}})
-        sym_list.append(mx.sym.Pooling(kernel=kernel, pool_type=pool_type,
+        sym_list.append(mx.sym.Pooling(pool_type=pool_type,
                                        pooling_convention=pooling_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,
+        sym_list.append(mx.sym.Pooling(pad=pad, stride=stride, 
pool_type=pool_type,
                                        pooling_convention=pooling_convention, 
global_pool=True, cudnn_off=False, 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, pool_type=pool_type,
+        sym_list.append(mx.sym.Pooling(pool_type=pool_type,
                                        pooling_convention=pooling_convention, 
global_pool=True, cudnn_off=False, 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,
+        sym_list.append(mx.sym.Pooling(pad=pad, stride=stride, 
pool_type=pool_type,
                                        pooling_convention=pooling_convention, 
global_pool=True, cudnn_off=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, pool_type=pool_type,
+        sym_list.append(mx.sym.Pooling(pool_type=pool_type,
                                        pooling_convention=pooling_convention, 
global_pool=True, cudnn_off=True, name='pool'))
-    
+
         check_consistency(sym_list, ctx_list)
-    
+
     def test_2d_pooling(pool_type):
         data = (2, 3, 20, 20)
         kernel = (4, 4)
         pad = (2, 2)
         stride = (2, 2)
-    
+
         ctx_list = []
         sym_list = []
-    
+
         pooling_convention = 'valid'
-    
+
         ctx_list.append({'ctx': mx.cpu(0), 'pool_data': data, 'type_dict': 
{'pool_data': np.float32}})
         sym_list.append(mx.sym.Pooling_v1(kernel=kernel, pad=pad, 
stride=stride, pool_type=pool_type,
 
 Review comment:
   We cannot prevent user from inputing a `kernel` to global pooling. Kernel 
size will be reset to image shape if `global_pool` is true. Code here: 
https://github.com/apache/incubator-mxnet/blob/master/src/operator/nn/pooling-inl.h#L143
 

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


With regards,
Apache Git Services

Reply via email to