masahi commented on code in PR #14536:
URL: https://github.com/apache/tvm/pull/14536#discussion_r1161628452
##########
tests/python/relay/test_pass_fake_quantization_to_integer.py:
##########
@@ -1114,5 +1114,36 @@ def test_fake_quantize_take():
compare_fq_to_int(op, [x_np])
+def test_fake_quantize_softmax():
+ x = relay.var("x", shape=[5, 10], dtype="float32")
+
+ x = relay.qnn.op.quantize(x, relay.const(0.08), relay.const(-48),
out_dtype="int8")
+ x = relay.qnn.op.dequantize(x, relay.const(0.08), relay.const(-48))
+ op = relay.op.nn.softmax(x, axis=1)
+ op = relay.qnn.op.quantize(op, relay.const(0.0038), relay.const(-128),
out_dtype="int8")
+ op = relay.qnn.op.dequantize(op, relay.const(0.0038), relay.const(-128))
+
+ x_np = np.random.random_sample([5, 10]).astype(np.float32) * 20.0 - 6
Review Comment:
Please test on more inputs, ideally on sampling from all int8 / uint8 range.
This choice looks very contrived.
--
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]