Leo-arm commented on a change in pull request #10463:
URL: https://github.com/apache/tvm/pull/10463#discussion_r838462817



##########
File path: tests/python/contrib/test_ethosn/test_mean.py
##########
@@ -40,18 +41,22 @@ def _get_model(shape, axis, keepdims, input_zp, input_sc, 
output_zp, output_sc,
 
 
 @requires_ethosn
-def test_mean():
-    trials = [(1, 7, 7, 2048), (1, 8, 8)]
[email protected]("dtype", ["uint8", "int8"])
[email protected]("shape", [(1, 7, 7, 2048), (1, 8, 8)])
+def test_mean(dtype, shape):
+    zp_min = np.iinfo(dtype).min
+    zp_max = np.iinfo(dtype).max
 
     np.random.seed(0)
-    for shape in trials:
-        inputs = {
-            "a": tvm.nd.array(np.random.randint(0, high=255, size=shape, 
dtype="uint8")),
-        }
-        outputs = []
-        for npu in [False, True]:
-            model = _get_model(shape, [1, 2], True, 128, 0.0784314, 128, 
0.0784314, "uint8")
-            mod = tei.make_module(model, [])
-            outputs.append(tei.build_and_run(mod, inputs, 1, {}, npu=npu))
-
-        tei.verify(outputs, "uint8", 1)
+    inputs = {
+        "a": tvm.nd.array(np.random.randint(zp_min, high=zp_max + 1, 
size=shape, dtype=dtype)),
+    }
+    outputs = []
+    for npu in [False, True]:

Review comment:
       If you are talking about npu false true then no because the results of 
the the two runs are compared within the same test.




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