From 7e807fef64e6773a1e039e3512cb9d7bc2df82d8 Mon Sep 17 00:00:00 2001 From: tqchen Date: Sun, 11 May 2025 17:41:47 -0700 Subject: [PATCH] [NODE] Fix structural equality for Array specialization This PR fixes the structural equality specialization for Array --- include/tvm/node/structural_equal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/tvm/node/structural_equal.h b/include/tvm/node/structural_equal.h index 372cbc52bcc8..46087f0bda40 100644 --- a/include/tvm/node/structural_equal.h +++ b/include/tvm/node/structural_equal.h @@ -357,7 +357,11 @@ class SEqualReducer { // depth as array comparison is pretty common. if (lhs.size() != rhs.size()) return false; for (size_t i = 0; i < lhs.size(); ++i) { - if (!(operator()(lhs[i], rhs[i]))) return false; + if constexpr (std::is_same_v) { + if (!(AnyEqual(lhs[i], rhs[i]))) return false; + } else { + if (!(operator()(lhs[i], rhs[i]))) return false; + } } return true; }