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 data order of H0 in GRU Operator #5623

Merged
merged 5 commits into from
Nov 17, 2017

Conversation

guoshengCS
Copy link
Contributor

fix #5421

@@ -14,6 +14,7 @@

#pragma once

#include "paddle/operators/lstm_op.h"
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

gru_value.prevOutValue = ordered_h0.data<T>();
} else {
gru_value.prevOutValue = nullptr;
}
Copy link
Contributor

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;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

gru_value.prevOutValue = nullptr;
}
if (h0 && h0_grad) {
gru_grad.prevOutGrad = ordered_h0_grad.data<T>();
Copy link
Contributor

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;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@qingqing01 qingqing01 left a comment

Choose a reason for hiding this comment

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

LGTM.

@guoshengCS guoshengCS merged commit 7a57b3b into PaddlePaddle:develop Nov 17, 2017
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.

Enable hidden state initialization in GRU Operator.
2 participants