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

Add python wrapper for lstm unit op. #6669

Merged
merged 9 commits into from
Dec 19, 2017
Merged

Conversation

pkuyym
Copy link
Contributor

@pkuyym pkuyym commented Dec 15, 2017

Resolves #6581.

@jacquesqiao
Copy link
Member

please add some explanation that we need to add fc before lstm_unit op
https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/operators/lstm_unit_op.cc#L54

"""
helper = LayerHelper('lstm_unit', **locals())

if len(x_t.shape) != 2:
Copy link
Member

Choose a reason for hiding this comment

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

should be removed, this will be check by infershape

Copy link
Member

Choose a reason for hiding this comment

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

please remove all the shape check, if need, can add into infershape of operators.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To make the exception more accurate, I think shape checking is also necessary here.

def lstm_unit(x_t,
hidden_t_prev,
cell_t_prev,
forget_bias=0.0,
Copy link
Member

Choose a reason for hiding this comment

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

add ParamAttr for fc's weight and bias

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.

@jacquesqiao
Copy link
Member

jacquesqiao commented Dec 19, 2017

please fix conflict

@jacquesqiao jacquesqiao reopened this Dec 19, 2017
@pkuyym pkuyym force-pushed the fix-6581 branch 3 times, most recently from 518c43e to 164271e Compare December 19, 2017 03:32
Copy link
Member

@jacquesqiao jacquesqiao left a comment

Choose a reason for hiding this comment

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

LGTM!

@pkuyym pkuyym merged commit 6f79126 into PaddlePaddle:develop Dec 19, 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.

2 participants