mehrdadh commented on a change in pull request #8715:
URL: https://github.com/apache/tvm/pull/8715#discussion_r688075508



##########
File path: tests/micro/zephyr/test_zephyr.py
##########
@@ -400,5 +396,137 @@ def test_tensors(sess):
         test_tensors(sess)
 
 
+def _get_conv2d_model(input_shape: tuple):
+    """Build a conv2d operator in Keras and returns an (IRModule, 
parameters)"""
+    import tensorflow as tf
+    from tensorflow import keras
+
+    model = keras.models.Sequential()
+    model.add(keras.layers.Conv2D(2, 3, input_shape=input_shape))
+    model.build()
+
+    inputs = {
+        i.name.split(":", 2)[0]: [x if x is not None else 1 for x in 
i.shape.as_list()]
+        for i in model.inputs
+    }
+    inputs = {k: [v[0], v[3], v[1], v[2]] for k, v in inputs.items()}
+    mod, params = relay.frontend.from_keras(model, inputs, layout="NCHW")
+    return mod, params

Review comment:
       done.




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