lhutton1 commented on code in PR #12970:
URL: https://github.com/apache/tvm/pull/12970#discussion_r988887568
##########
tests/python/contrib/test_ethosn/test_fullyconnected.py:
##########
@@ -66,26 +72,24 @@ def _get_model(
((1, 1280), 1000),
],
)
[email protected](
- "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):
[email protected]("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:
This seems like a limitation enforced by TFLite and not necessarily the NPU
driver stack, so I think its okay to leave this
(https://github.com/ARM-software/ethos-n-driver-stack/blob/main/SUPPORTED.md#fully-connected)
--
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]