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

sanirudh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new c8deb7fa36 Overriding the StructuralEqual() for easy usage (#16908)
c8deb7fa36 is described below

commit c8deb7fa36d3e05fc59bcd04c7415937778b278e
Author: sdalvi-quic <[email protected]>
AuthorDate: Mon Apr 29 23:12:56 2024 -0500

    Overriding the StructuralEqual() for easy usage (#16908)
    
    * Overriding the Structural Equal() for easy usage
    
    * lint error fixed
    
    * fixing white space lint error
    
    * whitespace lint error
---
 include/tvm/node/structural_equal.h | 4 +++-
 src/node/structural_equal.cc        | 5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/tvm/node/structural_equal.h 
b/include/tvm/node/structural_equal.h
index acc362758a..f5439bbb29 100644
--- a/include/tvm/node/structural_equal.h
+++ b/include/tvm/node/structural_equal.h
@@ -108,9 +108,11 @@ 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;
+  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 e0de514122..379a75f610 100644
--- a/src/node/structural_equal.cc
+++ b/src/node/structural_equal.cc
@@ -563,8 +563,9 @@ 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,

Reply via email to