-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TVMScript] StmtDoc Printing #12112
[TVMScript] StmtDoc Printing #12112
Conversation
e7de83b
to
871b3e3
Compare
f52ac4d
to
763ff53
Compare
This PR addes: - Awareness of expression (operator) precedence during Python code printing (`(* 1 (+ 2 3))` prints as `1 * (2 + 3)`) Tracking issue: apache#11912 This PR is in draft state because it's branched off an open PR apache#12112.
763ff53
to
d0d9006
Compare
doc.comment = "1\n2" | ||
with pytest.raises(ValueError) as e: | ||
to_python_script(doc) | ||
assert "cannot have newline" in str(e.value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's append some epilogues to this file so that it could be runnable with python /path/to/file
if __name__ == "__main__":
tvm.testing.main()
output_ << " -> "; | ||
PrintDoc(doc->return_type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we consider the case where return_type
is not given?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR: - Handle expression (operator) precedence during Python code printing (`(* 1 (+ 2 3))` prints as `1 * (2 + 3)`) - Addresses remaining feedback from previous PR apache#12112 - Reformats Python import with isort Tracking issue: apache#11912
This PR addes: - StmtDoc Printing in PythonDocPrinter Tracking issue: apache#11912
This PR: - Handle expression (operator) precedence during Python code printing (`(* 1 (+ 2 3))` prints as `1 * (2 + 3)`) - Addresses remaining feedback from previous PR apache#12112 - Reformats Python import with isort Tracking issue: apache#11912
This PR addes:
Tracking issue: #11912
cc @junrushao1994 @gbonik