junrushao1994 commented on code in PR #12101:
URL: https://github.com/apache/tvm/pull/12101#discussion_r936363849
##########
include/tvm/node/structural_equal.h:
##########
@@ -198,9 +285,41 @@ class SEqualReducer : public BaseValueEqual {
/*! \return Get the internal handler. */
Handler* operator->() const { return handler_; }
+ /*! \brief Check if this reducer is tracing paths to the first mismatch. */
+ bool IsPathTracingEnabled() const { return tracing_data_ != nullptr; }
+
+ /*!
+ * \brief Get the paths of the currently compared objects.
+ *
+ * Can only be called when `IsPathTracingEnabled()` is true.
+ */
+ const ObjectPathPair& GetCurrentObjectPaths() const;
+
+ /*!
+ * \brief Specify the object paths of a detected mismatch.
+ *
+ * Can only be called when `IsPathTracingEnabled()` is true.
+ */
+ void RecordMismatchPaths(const ObjectPathPair& paths) const;
+
private:
+ bool EnumAttrsEqual(int lhs, int rhs, const void* lhs_address, const void*
rhs_address) const;
+
+ bool ObjectAttrsEqual(const ObjectRef& lhs, const ObjectRef& rhs, bool
map_free_vars,
+ const ObjectPathPair* paths) const;
+
+ static void GetPathsFromAttrAddressesAndStoreMismatch(const void*
lhs_address,
+ const void*
rhs_address,
+ const PathTracingData*
tracing_data);
+
+ template <typename T>
+ static bool CompareAttributeValues(const T& lhs, const T& rhs,
+ const PathTracingData* tracing_data);
Review Comment:
Yeah my personal (again it's just subjective) preference is that we hide
anything that's not intended to be publicly used, except for non-static methods
when it requires some boilerplate code (adding helper friend classes /
methods). If a method is in a header file, I would prefer to document it more
or less to make it easier for others to catch up
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]