-
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]
T.allocate
with T.decl_buffer
syntax sugar for TVMScr…
…ipt printer (#13813) This PR implements the syntax sugar of `T.allocate` with `T.decl_buffer` for new TVMScript printer. This syntax sugar will skip the `T.allocate`, when its body is a matched `T.decl_buffer`, and the `Var` defined in `T.allocate` is only used in that `T.decl_buffer`. For example, it will change ```python buffer_data = T.allocate([128, 128]) buffer = T.decl_buffer([128, 128], data=buffer_data) ``` into ```python buffer = T.decl_buffer([128, 128]) ``` but keep the following `T.allocate` unchanged: ```python buffer_data = T.allocate([128, 128]) buffer_0 = T.decl_buffer([128, 128], data=buffer_data) buffer_1 = T.decl_buffer([128, 128], data=buffer_data) ``` and ```python buffer_data = T.allocate([128, 128]) buffer = T.decl_buffer([256, 256], data=buffer_data) ```
- Loading branch information
Showing
4 changed files
with
119 additions
and
85 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
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