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/10/12 21:57:34 UTC

[GitHub] [tvm] vinx13 commented on a diff in pull request #13056: [Relay] Fix simplifying consecutive casts when intermediate type has fewer bits

vinx13 commented on code in PR #13056:
URL: https://github.com/apache/tvm/pull/13056#discussion_r993930056


##########
src/relay/transforms/simplify_expr.cc:
##########
@@ -146,7 +146,7 @@ class SimplifyConsecutiveCast : public DFPatternRewrite {
       // BFloat cast cannot be omitted
       return false;
     }
-    if (origin.code() < cast.code()) {
+    if (origin.code() < cast.code() && origin.bits() <= cast.bits()) {

Review Comment:
   That make sense. Shall we also block conversions like int64 -> uint32? So the condition will be only checking bits when the cast is between int/uint



-- 
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