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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to