You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/12/02 14:49:04 UTC

[GitHub] [tvm] dchauhan-arm commented on a change in pull request #9508: [microNPU] Update Conv2D Tests to Use TF API to Gen Test Cases

dchauhan-arm commented on a change in pull request #9508:
URL: https://github.com/apache/tvm/pull/9508#discussion_r761165506



##########
File path: tests/python/contrib/test_ethosu/test_legalize.py
##########
@@ -221,135 +221,135 @@ def get_shape_expr(in_expr, out_expr):
     return shape
 
 
+def compute_ofm_shape(ifm_shape, padding, kernel_shape, strides, dilation):
+    if padding.lower() == "valid":
+        h = math.ceil((ifm_shape[1] - (kernel_shape[0] - 1) * dilation[0]) / strides[0])
+        w = math.ceil((ifm_shape[2] - (kernel_shape[1] - 1) * dilation[1]) / strides[1])
+    if padding.lower() == "same":
+        h = math.ceil(ifm_shape[1] / strides[0])
+        w = math.ceil(ifm_shape[2] / strides[1])
+    ofm_shape = [ifm_shape[0], h, w, kernel_shape[3]]
+    return ofm_shape

Review comment:
       Ah apologies, slipped through. If I remember correct, it failed the assertion for kernel_length == 2, which was previously 4. Should now work. Updating to use the function in infra.py now. cc @lhutton1 




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

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org