guberti commented on code in PR #13752:
URL: https://github.com/apache/tvm/pull/13752#discussion_r1113411550
##########
python/tvm/relay/qnn/op/_qnn.py:
##########
@@ -85,12 +91,72 @@ def simulated_dequantize_compute(attrs, inputs,
output_type):
register_strategy("qnn.conv2d", strategy.qnn_conv2d_strategy)
+def _get_clip_dtype_bounds(dtype):
+ """Returns the minimum and maximum values of a C integer data type."""
+ assert "int" in dtype
+ bits = int(dtype[dtype.find("int") + 3 :])
+
+ if dtype.startswith("int"):
+ return (-(2 ** (bits - 1)), 2 ** (bits - 1) - 1)
Review Comment:
That's much cleaner - fixed!
--
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]