-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[Typing][A-15] Add type annotations for paddle/nn/layer/common.py
#65197
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
python/paddle/nn/layer/common.py
Outdated
mode: Literal[ | ||
'linear', 'nearest', 'bilinear', 'bicubic', 'trilinear' | ||
] = 'nearest', |
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.
这块是不是也可以写个TypeAlias
这个可以等等 #65191,那边基本没啥大问题,应该先做 functional 再做 layer,API 签名基本没啥区别 |
Sorry to inform you that 7b5d791's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
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.
这个 PR 可以基于相关 functional 推进一下了~
python/paddle/nn/layer/common.py
Outdated
@@ -13,9 +13,23 @@ | |||
# limitations under the License. | |||
|
|||
# TODO: define the common classes to build a neural network |
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.
# TODO: define the common classes to build a neural network |
python/paddle/nn/layer/common.py
Outdated
return f'p={self.p}{name_str}' | ||
|
||
|
||
class FeatureAlphaDropout(Layer): |
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.
诶?这个是误添加还是?添加了这个的话,这个 PR 就必须依赖于 #64881 先合了
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.
那边是不是忘了,早就搞完了 ... ... 🫠
我先删了吧 ~
@@ -12,6 +12,8 @@ | |||
# See the License for the specific language governing permissions and | |||
# limitations under the License. | |||
|
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.
应该是忘记 PEP 563 了,导致运行时挂掉了
Update 20240625
|
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.
诶?不对,还有些 type error 需要解决~
|
python/paddle/nn/functional/conv.py
Outdated
from paddle import Tensor | ||
|
||
_PaddingSizeMode: TypeAlias = Literal['valid', 'same', 'VALID', 'SAME'] |
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.
这个要不移到 common?#65460 pool 也有在用
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.
OK~ 要不等 #65460 合了,我再统一修改这个 PR 吧 ~
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.
这个先吧,之后说不定还有其它地方在用,这种模块层次靠近底层的建议优先推进
一些下游任务可以推进了 |
PR Category
User Experience
PR Types
Improvements
Description
类型标注:
Related links
@SigureMo @megemini