yelite commented on code in PR #12324:
URL: https://github.com/apache/tvm/pull/12324#discussion_r939050770
##########
python/tvm/script/printer/doc.py:
##########
@@ -29,6 +29,21 @@
class Doc(Object):
"""Base class of all Docs"""
+ @property
+ def source_paths(self) -> Sequence[ObjectPath]:
+ """
+ The list of object paths of the source IR node.
+
+ This is used to trace back to the IR node position where
+ this Doc is generated, in order to position the diagnostic
+ message.
+ """
+ return self.__getattr__("source_paths") # pylint:
disable=unnecessary-dunder-call
Review Comment:
Without this property definition, `source_paths` is accessible but cannot be
mutated from Python, because the Python `Object` base class only has
`__getattr__`, and doesn't have `__setattr__`.
--
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]