Skip to content

Commit a54833d

Browse files
authored
[NODE] Fix structural equality for Array<Any> specialization (#17951)
This PR fixes the structural equality specialization for Array<Any>
1 parent d5cd945 commit a54833d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/tvm/node/structural_equal.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,11 @@ class SEqualReducer {
357357
// depth as array comparison is pretty common.
358358
if (lhs.size() != rhs.size()) return false;
359359
for (size_t i = 0; i < lhs.size(); ++i) {
360-
if (!(operator()(lhs[i], rhs[i]))) return false;
360+
if constexpr (std::is_same_v<T, ffi::Any>) {
361+
if (!(AnyEqual(lhs[i], rhs[i]))) return false;
362+
} else {
363+
if (!(operator()(lhs[i], rhs[i]))) return false;
364+
}
361365
}
362366
return true;
363367
}

0 commit comments

Comments
 (0)