diff --git a/paddle/fluid/operators/detection/roi_perspective_transform_op.cc b/paddle/fluid/operators/detection/roi_perspective_transform_op.cc index 4fd205395f8e9d..619d86c9bb252e 100644 --- a/paddle/fluid/operators/detection/roi_perspective_transform_op.cc +++ b/paddle/fluid/operators/detection/roi_perspective_transform_op.cc @@ -256,7 +256,7 @@ class CPUROIPerspectiveTransformOpKernel : public framework::OpKernel { auto transformed_width = ctx.Attr("transformed_width"); auto spatial_scale = ctx.Attr("spatial_scale"); - auto in_dims = in->dims(); + const auto& in_dims = in->dims(); int channels = in_dims[1]; int in_height = in_dims[2]; int in_width = in_dims[3];