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



##########
File path: tests/python/contrib/test_ethosu/test_codegen.py
##########
@@ -168,5 +166,95 @@ def create_graph_activation(input_tensor_name, 
input_tensor_shape, input_tensor_
         infra.verify_source(compiled_models, accel_type)
 
 
[email protected]("accel_type", ACCEL_TYPES)
[email protected]("ifm_shape", [(1, 55, 55, 3), (1, 23, 32, 7)])
[email protected](
+    "kernel_shape, activation",
+    [((3, 3), "relu"), ((1, 2), None)],
+)
[email protected]("padding", ["SAME", "VALID"])
[email protected]("strides, dilation", [((1, 1), (2, 2)), ((3, 2), (1, 
1))])
+def test_tflite_depthwise_conv2d(
+    accel_type,
+    ifm_shape,
+    kernel_shape,
+    padding,
+    strides,
+    dilation,
+    activation,
+):
+    dtype = "int8"
+
+    def create_tflite_graph():
+        tf.config.run_functions_eagerly(True)
+
+        class Model(tf.Module):
+            @tf.function
+            def depthwise_conv2d(self, x):
+                weight_shape = [kernel_shape[0], kernel_shape[1], 
ifm_shape[3], 1]
+                weight = tf.constant(np.random.uniform(size=weight_shape), 
dtype=tf.float32)
+                # The input strides to the TensorFlow API needs to be of shape 
1x4
+                tf_strides = [1, strides[0], strides[1], 1]
+                op = tf.nn.depthwise_conv2d(
+                    x, weight, strides=tf_strides, padding=padding, 
dilations=dilation
+                )
+                if activation:
+                    op = tf.nn.relu(op)
+                return op
+

Review comment:
       LGTM regarding tf.nn.depthwise_conv2d usage. Others' comments cover 
everything else.




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