This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch script/canonical-parser-df
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 3743d4ec0c42528f2fb4f740893636a3ebc8d6ec
Author: Tianqi Chen <[email protected]>
AuthorDate: Tue Sep 22 23:13:51 2026 +0000

    [FR] Match native comparison promotion in frontend reference IR
---
 tests/python/relax/test_frontend_nn_op.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/python/relax/test_frontend_nn_op.py 
b/tests/python/relax/test_frontend_nn_op.py
index ef313b95b5..eb12e25921 100644
--- a/tests/python/relax/test_frontend_nn_op.py
+++ b/tests/python/relax/test_frontend_nn_op.py
@@ -1172,14 +1172,14 @@ def test_renormalize_top_p_top_k_prob():
                     v_ax0, v_ax1 = T.axis.remap("SS", [ax0, ax1])
                     T.reads(cumsum_sorted[v_ax0, T.min(T.min(T.int64(0), 
v_ax1), v_ax1 + T.int64(1)):T.min(T.min(T.int64(0), v_ax1), v_ax1 + T.int64(1)) 
+ (T.max(T.max(T.int64(0), v_ax1), v_ax1 + T.int64(1)) + T.int64(1) - 
T.min(T.min(T.int64(0), v_ax1), v_ax1 + T.int64(1)))], top_p[v_ax0, 0], 
top_k[v_ax0, 0], sorted_prob[v_ax0, T.min(T.min(T.int64(0), v_ax1), v_ax1 + 
T.int64(1)):T.min(T.min(T.int64(0), v_ax1), v_ax1 + T.int64(1)) + 
(T.max(T.max(T.int64(0), v_ax1), v_ax1 + T.int64(1)) +  [...]
                     T.writes(cutoff[v_ax0, 0])
-                    if (cumsum_sorted[v_ax0, 0] < top_p[v_ax0, 0] and 
top_k[v_ax0, 0] > T.int64(1)) == T.bool(False):
+                    if T.Cast("int32", cumsum_sorted[v_ax0, 0] < top_p[v_ax0, 
0] and top_k[v_ax0, 0] > T.int64(1)) == 0:
                         cutoff[v_ax0, 0] = sorted_prob[v_ax0, 0]
                     else:
-                        if (cumsum_sorted[v_ax0, v_ax1] < top_p[v_ax0, 0] and 
v_ax1 + T.int64(1) < top_k[v_ax0, 0]) == T.bool(True):
+                        if T.Cast("int32", cumsum_sorted[v_ax0, v_ax1] < 
top_p[v_ax0, 0] and v_ax1 + T.int64(1) < top_k[v_ax0, 0]) == 1:
                             if v_ax1 + T.int64(1) == vocab_size:
                                 cutoff[v_ax0, 0] = sorted_prob[v_ax0, v_ax1]
                             else:
-                                if (cumsum_sorted[v_ax0, v_ax1 + T.int64(1)] < 
top_p[v_ax0, 0] and v_ax1 + T.int64(1) + T.int64(1) < top_k[v_ax0, 0]) == 
T.bool(False):
+                                if T.Cast("int32", cumsum_sorted[v_ax0, v_ax1 
+ T.int64(1)] < top_p[v_ax0, 0] and v_ax1 + T.int64(1) + T.int64(1) < 
top_k[v_ax0, 0]) == 0:
                                     cutoff[v_ax0, 0] = sorted_prob[v_ax0, 
v_ax1 + T.int64(1)]
 
         @R.function

Reply via email to