CoinCheung 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_r173060956
 
 

 ##########
 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:
   So shall I remove kernel only in the "even number" test cases and leave the 
odd test case with their kernel? Such as:
   ```
           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,  # keep the kernel for checking
                                          
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(pool_type=pool_type,  # remove kernel 
along with the missing pad and stride
                                          
pooling_convention=pooling_convention, global_pool=True, name='pool'))
   
   ```

----------------------------------------------------------------
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