anijain2305 commented on a change in pull request #6782:
URL: https://github.com/apache/incubator-tvm/pull/6782#discussion_r513723931
##########
File path: python/tvm/relay/frontend/qnn_torch.py
##########
@@ -826,6 +826,74 @@ def _impl(inputs, _):
return _impl
+def _linear_dynamic():
+ def _calculate_qparam(inp):
+ # reference ATen/native/quantized/cpu/qlinear_dynamic.cpp
+ # ChooseQuantizationParams function
+ mn = _op.min(inp)
+ mx = _op.max(inp)
+
+ # Ensure that the interval contains 0
+ mn = _op.minimum(mn, _op.const(0.0, dtype="float32"))
+ mx = _op.maximum(mx, _op.const(0.0, dtype="float32"))
+
+ qmax = 255
+
+ # reduce_range became True in v1.6
+ if is_version_greater_than("1.5.1"):
+ qmax = 127
Review comment:
Whats happening here? Should this be coupled with dtype - 127 should be
for int8 while 255 for uint8
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]