-
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
Added has_data_op #10513
Added has_data_op #10513
Conversation
1dc8153
to
2d498b1
Compare
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.
Please check https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/operators/is_empty_op.cc, seems we have such op already.
@@ -0,0 +1,70 @@ | |||
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. |
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.
2016 --> 2018
limitations under the License. */ | ||
|
||
#include "paddle/fluid/operators/has_data_op.h" | ||
#include <string> |
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.
exchange line15 with line16
void Make() override { | ||
// inputs and outputs stored in proto | ||
AddInput("X", "(LoDTensor) the LoDTensor to check"); | ||
AddOutput("Out", "(LoDTensor) the ouput of has_data_op"); |
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.
ouput --> output
has_data_op --> HasDataOp
Please add a dot at end of each sentence.
PADDLE_ENFORCE(ctx->HasOutput("Out"), | ||
"Output(Out) of HasDataOp should not be null."); | ||
ctx->SetOutputDim("Out", {1}); | ||
ctx->ShareLoD("X", "Out"); |
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.
LoD of Out
shouldn't inherit from X
, in fact, Out
has no LoD.
Resolved #10512