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

Fix a bug for TransLayer and add unit testing. #1809

Merged
merged 1 commit into from
Apr 20, 2017

Conversation

qingqing01
Copy link
Contributor

Fix #1805

@luotao1 luotao1 self-requested a review April 20, 2017 02:21
Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luotao1 luotao1 merged commit 68cfdf6 into PaddlePaddle:develop Apr 20, 2017
@@ -56,7 +56,14 @@ void TransLayer::backward(const UpdateCallback& callback) {
return;
}
MatrixPtr preGrad = getInputGrad(0);
outputGrad->transpose(preGrad, false);
if (preGrad) {
MatrixPtr transGrad = Matrix::create(preGrad->getHeight(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not need to create a memory outside, you may use transpose(transGrad, true) to allocate the memory inside

@qingqing01 qingqing01 deleted the trans_op branch July 7, 2017 13:36
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.

None yet

3 participants