-
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
Fix data order of H0 in GRU Operator #5623
Conversation
paddle/operators/gru_op.h
Outdated
@@ -14,6 +14,7 @@ | |||
|
|||
#pragma once | |||
|
|||
#include "paddle/operators/lstm_op.h" |
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.
Maybe write ReorderInitState
again in this file, not include lstm_op.h
.
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/gru_op.h
Outdated
gru_value.prevOutValue = ordered_h0.data<T>(); | ||
} else { | ||
gru_value.prevOutValue = nullptr; | ||
} |
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.
gru_value.prevOutValue = h0 ? ordered_h0.data<T>() : nullptr;
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/gru_op.h
Outdated
gru_value.prevOutValue = nullptr; | ||
} | ||
if (h0 && h0_grad) { | ||
gru_grad.prevOutGrad = ordered_h0_grad.data<T>(); |
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.
gru_grad.prevOutGrad = h0 && h0_grad ? ordered_h0_grad.data<T>() : nullptr;
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.
LGTM.
fix #5421