This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 115
[0D-Tensor] Add ExpandZeroDimPass, support 0D input and output #1428
Merged
thisjiang
merged 9 commits into
PaddlePaddle:develop
from
jiahy0825:support-0DTensor-by-pass
May 22, 2023
Merged
[0D-Tensor] Add ExpandZeroDimPass, support 0D input and output #1428
thisjiang
merged 9 commits into
PaddlePaddle:develop
from
jiahy0825:support-0DTensor-by-pass
May 22, 2023
Conversation
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
Thanks for your contribution! |
…upport-0DTensor-by-pass
thisjiang
reviewed
May 19, 2023
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.
在python/tests/passes目录下加个python端的Pass测试吧
Done |
thisjiang
approved these changes
May 19, 2023
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
jiahy0825
added a commit
to jiahy0825/CINN
that referenced
this pull request
May 25, 2023
…ePaddle#1428) * [0D-Tensor] Add ExpandZeroDimPass, support 0D input and output * Change graph pass to program pass, enable unit test of pass * polish codes * change year, 2021->2023 * Change CI paddle version 2.4.2->develop * disable paddle temporarily * Restore paddle version in this PR * add python unittest of pass
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[0D-Tensor] Add ExpandZeroDimPass, support 0D input and output
Note: What does ExpandZeroDimPass do?
Expand all 0D-Tensor (both inputs and outputs) to 1D-Tensor. To change the 0D-Tensor back when we fetch outputs, this PR records the 0D outputs Tensor's name before
ExpandZeroDimPass
.Note: Why register program pass instead of graph pass?
In the beginning, I try to register ExpandZeroDimPass as the first graph pass to handle 0D-Tensor, however, before the graph passes, the program passes such as
Decomposer
will change instructions with 0D-Tensor input.Such change is not what we want, and adapting the program pass with
ExpandZeroDimPass
will introduce a lot of redundant codes which couple program pass and graph pass. So I registerExpandZeroDimPass
as the first program pass in this PR.