-
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
Add lstm with recurrent projection layer operator #7792
Conversation
paddle/operators/lstmp_op.cc
Outdated
|
||
void InferShape(framework::InferShapeContext* ctx) const override { | ||
PADDLE_ENFORCE(ctx->HasInput("Input"), | ||
"Input(Input) of LSTMP should not be null."); |
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.
LSTMP --> LSTMPOp
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.
Done
paddle/operators/lstmp_op.cc
Outdated
if (ctx->HasInput("H0")) { | ||
PADDLE_ENFORCE(ctx->HasInput("C0"), | ||
"Input(C0) and Input(H0) of LSTMP should not " | ||
"be null at the same time."); |
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.
Better to change to C0 must be specified when H0 provided
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.
Done
paddle/operators/lstmp_op.h
Outdated
math::matmul<DeviceContext, T>(device_ctx, ordered_h0, false, | ||
*proj_weight, false, static_cast<T>(1.0), | ||
ordered_proj0, static_cast<T>(0.0)); | ||
if (share_cell_act) { |
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 consider to use string type.
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.
Done
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.
All done. Thanks!
paddle/operators/lstmp_op.cc
Outdated
|
||
void InferShape(framework::InferShapeContext* ctx) const override { | ||
PADDLE_ENFORCE(ctx->HasInput("Input"), | ||
"Input(Input) of LSTMP should not be null."); |
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.
Done
paddle/operators/lstmp_op.cc
Outdated
if (ctx->HasInput("H0")) { | ||
PADDLE_ENFORCE(ctx->HasInput("C0"), | ||
"Input(C0) and Input(H0) of LSTMP should not " | ||
"be null at the same time."); |
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.
Done
paddle/operators/lstmp_op.h
Outdated
math::matmul<DeviceContext, T>(device_ctx, ordered_h0, false, | ||
*proj_weight, false, static_cast<T>(1.0), | ||
ordered_proj0, static_cast<T>(0.0)); | ||
if (share_cell_act) { |
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.
Done
Fix #7547