FrozenGene commented on a change in pull request #4511: [CONV] Asymmetric 
padding
URL: https://github.com/apache/incubator-tvm/pull/4511#discussion_r357575493
 
 

 ##########
 File path: topi/tests/python/test_topi_conv2d_nchw.py
 ##########
 @@ -176,6 +184,20 @@ def test_conv2d_nchw():
     verify_conv2d_nchw(1,  512,   5, 126, 3, 1, 1)
     verify_conv2d_nchw(1,  256,   3, 126, 3, 1, 1)
 
+    # Asymmetric padding
+    verify_conv2d_nchw(1,   3, 224,  64, 7, 2, (0, 0, 1, 1))
+    verify_conv2d_nchw(1,  64,  56,  64, 3, 1, (3, 3, 2, 2))
+    verify_conv2d_nchw(1,  64,  56,  64, 1, 1, (1, 2, 2, 1))
+    verify_conv2d_nchw(1,  64,  56,  64, 1, 1, (1, 2))
+    verify_conv2d_nchw(1,  64,  56,  64, 3, 1, (3, 1))
+    verify_conv2d_nchw(1,  64,  56,  64, 3, 1, (0, 2))
+    verify_conv2d_nchw(1,  64,  56,  64, 3, 1, (1, 2), use_cudnn=True)
+    verify_conv2d_nchw(1,  64,  56,  64, 1, 1, "VALID")
+    verify_conv2d_nchw(1,  64,  56,  64, 3, 1, "VALID")
+    verify_conv2d_nchw(1,  64,  56,  64, 3, 1, "VALID", use_cudnn=True)
+    # Currnt not working
+    #verify_conv2d_nchw(1,  64,  56,  64, 1, 1, "SAME")
 
 Review comment:
   It is when your change the padding so that the error happened? 
   
    _get_workload should changed into pad_t, pad_l, pad_b, pad_r, then HPAD = 
pad_t + pad_b, WPAD = pad_l +pad_r.
   
   About your problem, could you make sure `pad_h = kernel[0] - 1`, what is 
`kernel`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

Reply via email to