lhutton1 commented on code in PR #12970:
URL: https://github.com/apache/tvm/pull/12970#discussion_r988896541


##########
tests/python/contrib/test_ethosn/test_fullyconnected.py:
##########
@@ -66,26 +72,24 @@ def _get_model(
         ((1, 1280), 1000),
     ],
 )
-@pytest.mark.parametrize(
-    "dtype,input_zp,input_sc,kernel_zp,kernel_sc",
-    [
-        ("uint8", 71, 0.580, 176, 1.498),
-        ("uint8", 166, 1.724, 138, 0.180),
-        ("int8", 71, 0.580, 0, 1.498),
-        ("int8", 120, 1.724, 0, 0.180),
-    ],
-)
-def test_fullyconnected(shape, out_channels, dtype, input_zp, input_sc, 
kernel_zp, kernel_sc):
+@pytest.mark.parametrize("dtype", ["uint8", "int8"])
+def test_fullyconnected(shape, out_channels, dtype):
     """Compare Fully Connected output with TVM."""
 
     np.random.seed(0)
+    iinfo = np.iinfo(dtype)
+    data_min = iinfo.min
+    data_max = iinfo.max
+
     inputs = {
-        "a": tvm.nd.array(
-            np.random.randint(np.iinfo(dtype).min, np.iinfo(dtype).max + 1, 
size=shape, dtype=dtype)
-        ),
+        "a": tvm.nd.array(np.random.randint(data_min, data_max + 1, 
size=shape, dtype=dtype)),
     }
-
     outputs = []
+
+    input_zp = np.random.randint(data_min, data_max)
+    input_sc = np.random.random() * 2
+    kernel_zp = np.random.randint(data_min, data_max)

Review Comment:
   Only the network tests at this point: 
https://github.com/apache/tvm/blob/main/tests/python/contrib/test_ethosn/test_networks.py



-- 
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: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to