leandron commented on a change in pull request #6267:
URL: https://github.com/apache/incubator-tvm/pull/6267#discussion_r469791300



##########
File path: python/tvm/topi/x86/depthwise_conv2d.py
##########
@@ -122,13 +122,24 @@ def depthwise_conv2d_NCHWc(cfg, data, kernel, strides, 
padding, dilation,
 
     strides = strides if isinstance(strides, (tuple, list)) else (strides, 
strides)
     HSTR, WSTR = strides
-    pad_top, pad_left, pad_down, pad_right = get_pad_tuple(padding, 
(filter_height, filter_width))
+    #pad_top, pad_left, pad_down, pad_right = get_pad_tuple(padding, 
(filter_height, filter_width))
 
     dh, dw = dilation if isinstance(dilation, (tuple, list)) else (dilation, 
dilation)
-    assert (dh, dw) == (1, 1), "Does not support dilation"
-
-    out_height = (in_height - filter_height + pad_top + pad_down) // HSTR + 1
-    out_width = (in_width - filter_width + pad_left + pad_right) // WSTR + 1
+    #assert (dh, dw) == (1, 1), "Does not support dilation"
+
+    dilated_kernel_h = (filter_height - 1) * dh + 1
+    dilated_kernel_w = (filter_width - 1) * dw + 1
+    pad_top, pad_left, pad_down, pad_right = get_pad_tuple(
+        padding, (dilated_kernel_h, dilated_kernel_w))
+    print("padding", pad_top, pad_left, pad_down, pad_right, dilated_kernel_h, 
padding)

Review comment:
       To output messages, it is better to make usage of the logging 
functionality. See the `logger` object, created in the beginning of this file.
   
   Same comment applies for other `print` statements below.

##########
File path: python/tvm/topi/x86/depthwise_conv2d.py
##########
@@ -122,13 +122,24 @@ def depthwise_conv2d_NCHWc(cfg, data, kernel, strides, 
padding, dilation,
 
     strides = strides if isinstance(strides, (tuple, list)) else (strides, 
strides)
     HSTR, WSTR = strides
-    pad_top, pad_left, pad_down, pad_right = get_pad_tuple(padding, 
(filter_height, filter_width))
+    #pad_top, pad_left, pad_down, pad_right = get_pad_tuple(padding, 
(filter_height, filter_width))

Review comment:
       If this is not useful anymore, please remove it rather than keeping it 
commented out here. Same for other commented lines below.

##########
File path: tests/python/topi/python/test_topi_depthwise_conv2d.py
##########
@@ -268,7 +268,7 @@ def depthwise_conv2d_with_workload_NCHWc(batch, in_channel, 
in_height, channel_m
     filter_width = filter_height
     stride_h = stride_w = stride
 
-    assert dilation == 1, "depthwise_conv2d_NCHWc currently does not support 
dilation."
+    #assert dilation == 1, "depthwise_conv2d_NCHWc currently does not support 
dilation."

Review comment:
       If this is not useful anymore, please remove it rather than keeping it 
commented out here.




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


Reply via email to