jackwish commented on a change in pull request #4714: Mxnet parser for Qnn
dialect
URL: https://github.com/apache/incubator-tvm/pull/4714#discussion_r368292444
##########
File path: python/tvm/relay/frontend/mxnet.py
##########
@@ -1075,6 +1097,378 @@ def _mx_cond(inputs, attrs, subgraphs):
return ret
+def _qnn_quantize(inputs, attrs):
+ out_dtype = 'int8'
+ out_type = attrs.get_str('out_type')
+ if out_type == 'auto':
+ if attrs.has_attr('min_calib_range') and
attrs.has_attr('max_calib_range'):
+ if attrs.get_float('min_calib_range') >= 0:
+ out_dtype = 'uint8'
+ else:
+ out_dtype = 'int8'
+ else:
+ out_dtype = out_type
+ if out_dtype not in {'int8', 'uint8'}:
+ raise ValueError('Unsupported out_dtype: %s' % out_dtype)
+ min_calib_range = attrs.get_float('min_calib_range', 0.0)
+ max_calib_range = attrs.get_float('max_calib_range', 0.0)
Review comment:
That's interesting, if there is not `min/max_calib_range` provided, we are
expecting the range to be `[0.0, 0.0)`? I am not very familiar with MxNet
calibration method, but it appears to me that the *detault* min/max can derive
from `out_dtype`?
----------------------------------------------------------------
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]
With regards,
Apache Git Services