gbonik commented on code in PR #12101:
URL: https://github.com/apache/tvm/pull/12101#discussion_r932588181


##########
python/tvm/runtime/object_path.py:
##########
@@ -122,3 +123,14 @@ class MapValuePath(ObjectPath):
 @tvm._ffi.register_object("MissingMapEntryPath")
 class MissingMapEntryPath(ObjectPath):
     pass
+
+
+@tvm._ffi.register_object("ObjectPathPair")
+class ObjectPathPair(Object):
+    @property
+    def lhs_path(self) -> ObjectPath:
+        return _ffi_node_api.ObjectPathPairLhsPath(self)
+
+    @property
+    def rhs_path(self) -> ObjectPath:
+        return _ffi_node_api.ObjectPathPairRhsPath(self)

Review Comment:
   The problem with this approach is that we can't `#include "reflection.h"` in 
the `structural_equal.h" because of a circular dependency (`reflection.h` 
already includes `structural_equal.h`). We could forward-declare the 
`AttrVisitor` class in the header, and put the implementation of `VisitAttrs` 
in the cc file, but we would risk getting the two out of sync. I think this is 
really a special case because this ObjectPathPair is part of the reflection 
mechanism, so I think it is okay to have the extra boilerplate for the getters.



-- 
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]

Reply via email to