tvm
tvm copied to clipboard
[TVMScript] Text underlining in DocPrinter based on Doc's source_paths
This adds an ability to print a "diagnostic marker" based on a given ObjectPath. For example, say we are printing a fragment of TIR like
for i in T.serial(10):
a[i] = 5
and we would like bring the user's attention to the bound of the loop:
for i in T.serial(10):
^^
a[i] = 5
In this case we would give the doc printer an object path that represents this loop bound, i.e. something like path_to_underline=ObjectPath.root().attr("extent")
Tracking issue: https://github.com/apache/tvm/issues/11912 cc @yelite @junrushao1994
Let's fix the lint and get it in :-)
Thanks for the PR! It's merged :-)