-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 grad grad for AvgPool2D #35388
Add grad grad for AvgPool2D #35388
Conversation
Thanks for your contribution! |
@@ -381,5 +381,29 @@ def test_grad(self): | |||
self.func(p) | |||
|
|||
|
|||
class TestAvgPool2DDoubleGradCheck(unittest.TestCase): |
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.
建议多加一些单测,可以参考下conv的二次梯度单测。
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.
是否更新了官方doc?
using framework::SingleGradOpMaker<T>::SingleGradOpMaker; | ||
|
||
protected: | ||
void Apply(GradOpPtr<T> grad_op) const override { |
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.
可以在ProtoMaker里直接复用forward op,下面就不用实现PoolGradGradKernel了。 参考
Paddle/paddle/fluid/operators/transpose_op.cc
Line 293 in 13bbb6b
grad_op->SetType("transpose2"); |
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
* add pool2d grad grad * dbg * add unittest * update format * add more unittests * dbg
PR types
New features
PR changes
OPs
Describe
Add grad grad for AvgPool2D