You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/04/08 05:10:43 UTC

[GitHub] [tvm] AndrewZhaoLuo commented on a diff in pull request #10922: [FQ2I] Add abs to FQ2I

AndrewZhaoLuo commented on code in PR #10922:
URL: https://github.com/apache/tvm/pull/10922#discussion_r845740976


##########
python/tvm/relay/transform/fake_quantization_to_integer.py:
##########
@@ -109,6 +109,32 @@ def identity(expr, type_map):
 register_unary_identity("image.resize2d")
 
 
+@register_fake_quantization_to_integer("abs")
+def abs(expr, type_map):
+    assert len(expr.args) == 1
+    arg = expr.args[0]
+    t = type_map[arg]
+
+    if t.dtype == "int8":

Review Comment:
   I suggest you use np.iinfo
   
   e.g. 
   `np.iinfo('int32').min`



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org