Hzfengsy commented on a change in pull request #9115: URL: https://github.com/apache/tvm/pull/9115#discussion_r719009665
########## File path: tests/python/unittest/test_tvmscript_spans.py ########## @@ -18,26 +18,26 @@ import inspect import tvm -import tvm.script -from tvm import tir +from tvm.script import tir as T [email protected]_func def loops() -> None: - for i in tir.parallel(0, 2): - for j in tir.serial(0, 1): - for z in tir.vectorized(3, 4): - tir.evaluate(0) + for i in T.parallel(0, 2): + for j in T.serial(0, 1): + for z in T.vectorized(3, 4): + T.evaluate(0) def test_loops(): - _, start_line = inspect.getsourcelines(loops) - parsed = tvm.script.tir(loops) + start_line = 25 Review comment: Yes, I 100% agree that relative line numbers are better. However, we ensure that functions need have decorators so that we can not get the Python function Object to get line number. -- 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]
