-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TVMScript] Implicit root block syntax sugar for TVMScript printer (#…
…13819) This PR implements the syntax sugar of implicit root block for new TVMScript printer. This syntax sugar will skip the `T.block("root")`, when the root block realize is simple and we shall reconstruct that root block via `tvm::tir::ScriptComplete` when roundtripping. For example, it will change ```python @T.prim_func def root_block_explicitly(): with T.block("root"): a = T.alloc_buffer([128, 128]) for i, j in T.grid(128, 128): with T.block(): T.evaluate(0) ``` into ```python @T.prim_func def main(): a = T.alloc_buffer((128, 128)) for i, j in T.grid(128, 128): with T.block(""): T.evaluate(0) ```
- Loading branch information
Showing
2 changed files
with
74 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters