-
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] Allow use of Python builtins in script #15492
Conversation
The builtins are already supported by `eval` (they are automatically injected in the global scope), but they are not recognized by the evaluator's checks. When the evaluator sees doc.Name, it looks it up in the current `var_table`, and flags an error if it's not there. Make the evaluator also consult the current builtins before erroring out.
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
2 similar comments
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
Buitin functions in T.prim_func's body are evaluated when the actual PrimFunc is created, so this test will print 'a' before generating `T.evaluate(0)` (i.e. equivalent of an empty statement) as the body.
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! Nice addition
The builtins are already supported by
eval
(they are automatically injected in the global scope), but they are not recognized by the evaluator's checks. When the evaluator sees doc.Name, it looks it up in the currentvar_table
, and flags an error if it's not there.Make the evaluator also consult the current builtins before erroring out.