junrushao1994 commented on code in PR #12101:
URL: https://github.com/apache/tvm/pull/12101#discussion_r931680834
##########
src/node/structural_equal.cc:
##########
@@ -42,6 +62,133 @@ bool ReflectionVTable::SEqualReduce(const Object* self,
const Object* other,
return fsequal_reduce_[tindex](self, other, equal);
}
+struct SEqualReducer::PathTracingData {
+ ObjectPathPair current_paths;
+ ObjectRef lhs_object;
+ ObjectRef rhs_object;
+ Optional<ObjectPathPair>* first_mismatch;
+
+ ObjectPathPair GetPathsForAttrs(const ObjectRef& lhs, const ObjectRef& rhs)
const {
+ Optional<String> lhs_attr_key = GetAttrKeyByAddress(lhs_object.get(),
&lhs);
+ Optional<String> rhs_attr_key = GetAttrKeyByAddress(rhs_object.get(),
&rhs);
+ return ObjectPathPair(current_paths->lhs_path->Attr(lhs_attr_key),
+ current_paths->rhs_path->Attr(rhs_attr_key));
+ }
+};
+
+bool SEqualReducer::operator()(const ObjectRef& lhs, const ObjectRef& rhs)
const {
+ if (tracing_data_ == nullptr) {
+ // Fast path: no tracing
+ return handler_->SEqualReduce(lhs, rhs, map_free_vars_, {});
Review Comment:
nit:
```suggestion
return handler_->SEqualReduce(lhs, rhs, map_free_vars_, NullOpt);
```
--
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]