tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] xqdan commented on a change in pull request #5749: [ARITH][BACKPORT-0.6] fix a min/max simplify bug
Date Tue, 09 Jun 2020 16:09:41 GMT

xqdan commented on a change in pull request #5749:
URL: https://github.com/apache/incubator-tvm/pull/5749#discussion_r437126069



##########
File path: src/arith/rewrite_simplify.cc
##########
@@ -1026,7 +1026,9 @@ PrimExpr RewriteSimplifier::Impl::VisitExpr_(const MinNode* op) {
       int64_t c1val = c1.Eval()->value;
       int64_t c2val = c2.Eval()->value;
       if (c2val % c1val == 0) {
-        if (c2val / c1val >= 0) {
+        if (c2val == 0) {
+          return c1val > 0 ? (min(x, 0) * c1val).Eval() : (max(x, 0) * c1val).Eval();
+        } else if (c2val / c1val > 0) {

Review comment:
       ok, fixed




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



Mime
View raw message