Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion paddle/operators/conv_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,12 @@ class GemmConvGradKernel : public framework::OpKernel<T> {

if (input_grad) {
input_grad->mutable_data<T>(context.GetPlace());
set_zero(dev_ctx, input_grad, static_cast<T>(0));

// if is_expand is false, the operation of set_zero is unnecessary,
// because math::matmul will reset input_grad.
if (is_expand) {
set_zero(dev_ctx, input_grad, static_cast<T>(0));
}
math::Col2VolFunctor<DeviceContext, T> col2vol;
math::Col2ImFunctor<math::ColFormat::kCFO, DeviceContext, T> col2im;

Expand Down
1 change: 0 additions & 1 deletion paddle/operators/conv_transpose_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ class GemmConvTransposeGradKernel : public framework::OpKernel<T> {

if (input_grad) {
input_grad->mutable_data<T>(context.GetPlace());
set_zero(dev_ctx, input_grad, static_cast<T>(0));
}
if (filter_grad) { // filter size (m, c, k_h, k_w)
filter_grad->mutable_data<T>(context.GetPlace());
Expand Down