-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Dy2stat]support Python3 type annotation #36544
Merged
Aurelius84
merged 11 commits into
PaddlePaddle:develop
from
0x45f:dy2stat_type_annotation
Nov 3, 2021
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
196e9f5
Support Py3 type annotations in @to_static
Aurelius84 8b8167c
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
0x45f d640e7d
support type hint for args in func
0x45f 392cc0b
support type hint assign
0x45f 7d376bb
if annotation and value(Constant) are diffent type, we use value type
0x45f 72be215
polish type_from_annotation()
0x45f b4ebd10
Merge branch 'develop' into dy2stat_type_annotation
0x45f 54c6f4c
code format
0x45f 4b97654
code format
0x45f 4c3ea0b
remove useless commentary
0x45f 03b20a5
fix review
0x45f File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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.
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.
这里只会对类似
x: float = 2.1
作处理,对于类似self.x: float = 2.1
是不会处理? 因为self.x
是一个gast.Attribute,而不是一个gast.Name
.此PR 若是不支持的,这里记一个TODO,需要确认下是否有类似非gats.Name的场景和需求
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.
在之前代码中的Assign node也没有支持类似
self.x= 2.1
赋值语句,所以在AnnAssign node也暂时不支持self.x: float = 2.1
类似语句。后续可以确认是否需要支持此类赋值语句。