shoubhik commented on a change in pull request #4714: Mxnet parser for Qnn 
dialect
URL: https://github.com/apache/incubator-tvm/pull/4714#discussion_r368707578
 
 

 ##########
 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:
   You are correct. The zeros should not be there. In fact there min and max 
operators. i'll fix this.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to