Mousius commented on a change in pull request #9409:
URL: https://github.com/apache/tvm/pull/9409#discussion_r755581293



##########
File path: tests/python/contrib/test_cmsisnn/test_conv2d.py
##########
@@ -147,40 +149,45 @@ def test_op_int8(
     input_scale,
     kernel_scale,
     out_channels,
+    conv_type,
+    depth_multiplier,
 ):
     interface_api = "c"
     use_unpacked_api = True
     test_runner = AOT_CORSTONE300_RUNNER
 
-    kernel_zero_point = 0
+    dtype = "int8"
     groups = 1
     weight_format = "HWIO"
     kernel_h = kernel_size[0]
     kernel_w = kernel_size[1]
-    dtype = "int8"
+    kernel_shape = (kernel_h, kernel_w, ifm_shape[3] // groups, out_channels)
+    kernel_zero_point = 0
     in_min, in_max = get_range_for_dtype_str(dtype)
 
-    weight_shape = None
-    if weight_format == "HWIO":
-        weight_shape = (kernel_h, kernel_w, ifm_shape[3] // groups, 
out_channels)
-    else:
-        weight_shape = (kernel_h, kernel_w, ifm_shape[3], out_channels)
+    if conv_type == "depthwise":
+        groups = ifm_shape[3]
+        weight_format = "HWOI"
+        kernel_shape = (kernel_h, kernel_w, ifm_shape[3], depth_multiplier)
+        out_channels = ifm_shape[3] * depth_multiplier
+        ks_len = len(kernel_scale)
+        kernel_scale = [kernel_scale[i % ks_len] for i in range(out_channels)]

Review comment:
       The actual feature here is different, even if the internals are the 
same, and there's different logic for constructing the different test cases as 
demonstrated by the branch here. It can still make use of many of the same 
functions and be fairly minimal I think?




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