gromero commented on a change in pull request #9500:
URL: https://github.com/apache/tvm/pull/9500#discussion_r754509946



##########
File path: tests/python/relay/aot/test_crt_aot.py
##########
@@ -693,5 +694,108 @@ def @main(%data: Tensor[(1, 4, 4, 4), float32], %weight: 
Tensor[(4, 4, 3, 3), fl
     assert source.count("TVMBackendAllocWorkspace") == 3
 
 
+def test_device_api_hooks():
+    """Check for Device API hooks"""
+
+    # Ideally we should have a sample Target registered here
+    # but we're going to re-use this for now
+    pytest.importorskip("ethosu.vela")
+    import tensorflow as tf
+    import tflite.Model
+
+    from tests.python.contrib.test_ethosu import infra
+    from tvm.relay.op.contrib.ethosu import partition_for_ethosu
+
+    def create_tflite_graph():
+        tf.config.run_functions_eagerly(True)
+
+        class Model(tf.Module):
+            @tf.function
+            def tf_function(self, x):
+                return tf.nn.max_pool(x, [1, 2], [1, 2], "SAME")
+
+        def representative_dataset():
+            for _ in range(100):
+                data = np.random.rand(*tuple([1, 3, 4, 3]))

Review comment:
       @Mousius Hi! Yeah, I thought of that too (avoiding the unpack too), 
however I assumed you would like to keep it as `[1, 3, 4, 3]` just to be "more 
explicit" by keeping the dimensions written in a form as you pass later for 
example to `tf.TensorSpec`. Either way looks fine to me, just the form with 
"tuple" seems superfluous :)




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