From 874fbd76928a358381f462d6f21bbd668824ec78 Mon Sep 17 00:00:00 2001 From: snigdha dalvi Date: Sat, 20 Apr 2024 00:10:49 -0500 Subject: [PATCH 1/4] Overriding the Structural Equal() for easy usage --- include/tvm/node/structural_equal.h | 2 +- src/node/structural_equal.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/tvm/node/structural_equal.h b/include/tvm/node/structural_equal.h index acc362758a7c..990530cbc1be 100644 --- a/include/tvm/node/structural_equal.h +++ b/include/tvm/node/structural_equal.h @@ -110,7 +110,7 @@ class StructuralEqual : public BaseValueEqual { * \param rhs The right operand. * \return The comparison result. */ - TVM_DLL bool operator()(const ObjectRef& lhs, const ObjectRef& rhs) const; + TVM_DLL bool operator()(const ObjectRef& lhs, const ObjectRef& rhs, const bool map_free_params = false) const; }; /*! diff --git a/src/node/structural_equal.cc b/src/node/structural_equal.cc index e0de514122b8..f91e056d0438 100644 --- a/src/node/structural_equal.cc +++ b/src/node/structural_equal.cc @@ -563,8 +563,8 @@ TVM_REGISTER_GLOBAL("node.GetFirstStructuralMismatch") return first_mismatch; }); -bool StructuralEqual::operator()(const ObjectRef& lhs, const ObjectRef& rhs) const { - return SEqualHandlerDefault(false, nullptr, false).Equal(lhs, rhs, false); +bool StructuralEqual::operator()(const ObjectRef& lhs, const ObjectRef& rhs, bool map_free_params) const { + return SEqualHandlerDefault(false, nullptr, false).Equal(lhs, rhs, map_free_params); } bool NDArrayEqual(const runtime::NDArray::Container* lhs, const runtime::NDArray::Container* rhs, From c01b402c7d1280e790661d1febf00aa29ae77166 Mon Sep 17 00:00:00 2001 From: snigdha dalvi Date: Tue, 23 Apr 2024 13:49:14 -0500 Subject: [PATCH 2/4] lint error fixed --- include/tvm/node/structural_equal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/tvm/node/structural_equal.h b/include/tvm/node/structural_equal.h index 990530cbc1be..99d12c08b7e0 100644 --- a/include/tvm/node/structural_equal.h +++ b/include/tvm/node/structural_equal.h @@ -108,6 +108,7 @@ class StructuralEqual : public BaseValueEqual { * \brief Compare objects via strutural equal. * \param lhs The left operand. * \param rhs The right operand. + * \param map_free_params Whether or not to map free variables. * \return The comparison result. */ TVM_DLL bool operator()(const ObjectRef& lhs, const ObjectRef& rhs, const bool map_free_params = false) const; From a3bb91425e109967a97248269bb227eb7e81add4 Mon Sep 17 00:00:00 2001 From: snigdha dalvi Date: Wed, 24 Apr 2024 09:51:30 -0500 Subject: [PATCH 3/4] fixing white space lint error --- include/tvm/node/structural_equal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/tvm/node/structural_equal.h b/include/tvm/node/structural_equal.h index 99d12c08b7e0..f5439bbb290c 100644 --- a/include/tvm/node/structural_equal.h +++ b/include/tvm/node/structural_equal.h @@ -111,7 +111,8 @@ class StructuralEqual : public BaseValueEqual { * \param map_free_params Whether or not to map free variables. * \return The comparison result. */ - TVM_DLL bool operator()(const ObjectRef& lhs, const ObjectRef& rhs, const bool map_free_params = false) const; + TVM_DLL bool operator()(const ObjectRef& lhs, const ObjectRef& rhs, + const bool map_free_params = false) const; }; /*! From b9b452b2daace46dd0c192ea1eaff806a0b23c76 Mon Sep 17 00:00:00 2001 From: snigdha dalvi Date: Wed, 24 Apr 2024 10:28:05 -0500 Subject: [PATCH 4/4] whitespace lint error --- src/node/structural_equal.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/structural_equal.cc b/src/node/structural_equal.cc index f91e056d0438..379a75f6109b 100644 --- a/src/node/structural_equal.cc +++ b/src/node/structural_equal.cc @@ -563,7 +563,8 @@ TVM_REGISTER_GLOBAL("node.GetFirstStructuralMismatch") return first_mismatch; }); -bool StructuralEqual::operator()(const ObjectRef& lhs, const ObjectRef& rhs, bool map_free_params) const { +bool StructuralEqual::operator()(const ObjectRef& lhs, const ObjectRef& rhs, + bool map_free_params) const { return SEqualHandlerDefault(false, nullptr, false).Equal(lhs, rhs, map_free_params); }