-
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
API(lstm_unit, lstmp, sequence_mask, sequence_enumerate, sequence_conv) error message enhancement #27572
Conversation
lstmp error message enhancement. sequence_conv error message enhencement. sequence_enumerate error message enhencement. sequence_mask error message enhencement.
… yxp0925 Merge branch 'develop'.
Thanks for your contribution! |
✅ This PR's description meets the template requirements! |
… yxp0925 Merge branch 'develop'.
@@ -44,7 +44,9 @@ class SequenceEnumerateOpMaker : public framework::OpProtoAndCheckerMaker { | |||
AddAttr<int>("win_size", "(int) The enumerate sequence window size.") | |||
.AddCustomChecker([](const int& win_size) { | |||
PADDLE_ENFORCE(win_size >= 2, | |||
"The window size should be not less than 2."); | |||
platform::errors::InvalidArgument( |
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.
这里的PADDLE_ENFORCE
还请使用PADDLE_ENFORCE_EQ
这种
PADDLE_ENFORCE(v < 0 || v >= 1, | ||
"Attr(maxlen) must be less than 0 or larger than 1"); | ||
PADDLE_ENFORCE( | ||
v < 0 || v >= 1, |
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.
这里的PADDLE_ENFORCE
还请使用PADDLE_ENFORCE_EQ
这种
PR types
Bug fixes
PR changes
OPs
Describe
API(lstm_unit, lstmp, sequence_mask, sequence_enumerate, sequence_conv) error message enhancement.
代码示例:
报错预览: