From 7d7e29957f36a97226279460300ca81be989c23b Mon Sep 17 00:00:00 2001 From: whs Date: Wed, 8 May 2019 11:08:09 +0800 Subject: [PATCH] Fix bp of roi perspective transform op. (#17216) --- .../fluid/operators/detection/roi_perspective_transform_op.cu | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/paddle/fluid/operators/detection/roi_perspective_transform_op.cu b/paddle/fluid/operators/detection/roi_perspective_transform_op.cu index 74c8384e1e..85eb0c45e0 100644 --- a/paddle/fluid/operators/detection/roi_perspective_transform_op.cu +++ b/paddle/fluid/operators/detection/roi_perspective_transform_op.cu @@ -466,6 +466,10 @@ class CUDAROIPerspectiveTransformGradOpKernel : public framework::OpKernel { auto* in_grad = ctx.Output(framework::GradVarName("X")); T* in_grad_data = in_grad->mutable_data(ctx.GetPlace()); + + math::SetConstant set_zero; + set_zero(ctx.cuda_device_context(), in_grad, static_cast(0)); + const T* out_grad_data = out_grad->data(); const int* out2in_idx_data = out2in_idx->data(); const T* out2in_w_data = out2in_w->data(); -- GitLab