-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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/sequence conv #5266
Fix/sequence conv #5266
Conversation
@@ -130,10 +130,10 @@ class ContextProjectFunctor { | |||
out_t.Resize({sequence_height, context_length * sequence_width}); | |||
} | |||
} | |||
if (padding_trainable) { | |||
if (col != 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.
This is not appropriate, because col != nullptr
always is true.
paddle/operators/sequence_conv_op.h
Outdated
"Input(PaddingData)'s shape is not consistent with 'context_start' " | ||
"and 'context_length'."); | ||
} | ||
|
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.
I think line 48~64 should be placed in infershape phase.
Great. PaddingTrainable is redundant. |
@@ -242,10 +242,10 @@ class ContextProjectGradFunctor { | |||
} | |||
} | |||
if (pad_grad) { | |||
if (padding_trainable) { | |||
if (padding_data) { |
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.
The two judgments can be written together.
if (pad_grad && padding_data)
@@ -4,6 +4,7 @@ | |||
import unittest | |||
import op_test | |||
import numpy as np | |||
exit(0) |
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.
Should be removed?
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.
No, it's a newly merged code and contains a bug. I am refactoring it.
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 add an TODO here
python/paddle/v2/framework/layers.py
Outdated
@@ -364,12 +362,12 @@ def conv2d(input, | |||
|
|||
|
|||
def sequence_pool(input, pool_type, **kwargs): | |||
ENUM_POOL_TYPE = set(["MAX", "AVG", "SQRT", "LAST", "FIRST"]) | |||
ENUM_POOL_TYPE = set(["MAX", "SUM", "AVERAGE", "SQRT", "LAST", "FIRST"]) |
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.
AVERAGE => 'AVG'?
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.
It's weird implemented in sequence_pool operator. Because it has been used in chapter5 and the chapter6 in coming, so I will fix it after chapter6 and other sequence PRs merged.
Otherwise, it will make our in progress things into a mess.
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!
感谢您给PaddlePaddle贡献代码。由于Paddle V1/V2版本已不再维护,相关代码也已从develop分支上删除,因此关闭您的PR,欢迎您向Paddle最新版-Fluid贡献代码。 |
fix #5263 item2