gbonik commented on code in PR #12101: URL: https://github.com/apache/tvm/pull/12101#discussion_r931437519
########## include/tvm/node/structural_equal.h: ########## @@ -56,6 +57,31 @@ class BaseValueEqual { } }; +/*! + * \brief Pair of `ObjectPath`s, one for each object being tested for structural equality. + */ +struct ObjectPathPair { + ObjectPath lhs_path; + ObjectPath rhs_path; +}; + +// Could be replaced with std::optional<ObjectPathPair> +class OptionalObjectPathPair { + public: + OptionalObjectPathPair() = default; + + OptionalObjectPathPair(const ObjectPathPair& p) // NOLINT(runtime/explicit) + : lhs_path(p.lhs_path), rhs_path(p.rhs_path) {} + + bool defined() const { return lhs_path.defined(); } + + ObjectPathPair value() const { return {lhs_path.value(), rhs_path.value()}; } + + private: + Optional<ObjectPath> lhs_path; + Optional<ObjectPath> rhs_path; +}; + Review Comment: That's correct, but making it a TVM object would require heap allocation. -- 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: commits-unsubscr...@tvm.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org