Skip to content
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

Merged
merged 23 commits into from
Oct 9, 2020

Conversation

smallv0221
Copy link
Contributor

@smallv0221 smallv0221 commented Sep 25, 2020

PR types

Bug fixes

PR changes

OPs

Describe

API(lstm_unit, lstmp, sequence_mask, sequence_enumerate, sequence_conv) error message enhancement.

代码示例:

import paddle
x = paddle.randn((12,12,12))
paddle.fluid.core.ops.lstm_unit(x,x)

报错预览:

lstm_unit error after

lstmp error message enhancement.
sequence_conv error message enhencement.
sequence_enumerate error message enhencement.
sequence_mask error message enhencement.
@CLAassistant
Copy link

CLAassistant commented Sep 25, 2020

CLA assistant check
All committers have signed the CLA.

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Sep 25, 2020

✅ This PR's description meets the template requirements!
Please wait for other CI results.

@@ -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(
Copy link
Contributor

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,
Copy link
Contributor

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这种

guoshengCS
guoshengCS previously approved these changes Sep 30, 2020
@guoshengCS guoshengCS merged commit 057e28b into PaddlePaddle:develop Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants