-
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
[Typing][B-59] Add type annotations for python/paddle/text/viterbi_decode.py
#65919
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
python/paddle/text/viterbi_decode.py
Outdated
potentials: Tensor | ||
lengths: Tensor |
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.
木有这两个参数吧?
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.
在forward里面用的,这里不用初始化吗?
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.
这里从来就不是「初始化」,这里是表明该类的实例在初始化后会有哪些属性,以及相应的类型,初始化怎么可能不绑定值?而且初始化是对运行时有影响的,我们怎么可能允许在这个任务加「初始化」?
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.
看了m佬提供的#65660 (comment) ,明白了。
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
B59