shoubhik commented on a change in pull request #4714: Mxnet parser for Qnn
dialect
URL: https://github.com/apache/incubator-tvm/pull/4714#discussion_r368708311
##########
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'}:
Review comment:
out_dtype can be auto too. in which case we infer it based on the min and
max values.
----------------------------------------------------------------
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