diff --git a/paddle/fluid/operators/fused/fused_seqpool_cvm_op_xpu.cc b/paddle/fluid/operators/fused/fused_seqpool_cvm_op_xpu.cc index b9b6bc1b3e182..c77388121da60 100644 --- a/paddle/fluid/operators/fused/fused_seqpool_cvm_op_xpu.cc +++ b/paddle/fluid/operators/fused/fused_seqpool_cvm_op_xpu.cc @@ -131,7 +131,7 @@ class FusedSeqpoolCVMOpXPUKernel : public framework::OpKernel { } else { cpu_y_addr_vec[i] = reinterpret_cast(out[i]->mutable_data(place)); } - auto x_lod = ins[i]->lod()[0]; + auto& x_lod = ins[i]->lod()[0]; #ifdef PADDLE_WITH_MKLML #pragma omp parallel for #endif @@ -225,10 +225,9 @@ class FusedSeqpoolCVMGradOpXPUKernel : public framework::OpKernel { T* dx_data = dx->mutable_data(place); // T* dx_data = dx->mutable_data(place); T* dy_data = const_cast(dy->data()); - auto lod = dx->lod(); cpu_dx_list[k] = dx_data; cpu_dy_list[k] = (const T*)dy_data; - auto lod_level_0 = dx->lod()[0]; + auto& lod_level_0 = dx->lod()[0]; int lod_size = lod_level_0.size(); for (int i = 0; i < lod_size; i++) { cpu_lodx[i + start_index] = lod_level_0[i]; diff --git a/paddle/fluid/operators/fused/fused_seqpool_cvm_with_conv_op_xpu.cc b/paddle/fluid/operators/fused/fused_seqpool_cvm_with_conv_op_xpu.cc index 3f6ec1713e344..f36e6dfb11fb0 100644 --- a/paddle/fluid/operators/fused/fused_seqpool_cvm_with_conv_op_xpu.cc +++ b/paddle/fluid/operators/fused/fused_seqpool_cvm_with_conv_op_xpu.cc @@ -103,7 +103,7 @@ class FusedSeqpoolCVMWithConvOpXPUKernel : public framework::OpKernel { } else { cpu_y_addr_vec[i] = reinterpret_cast(out[i]->mutable_data(place)); } - auto x_lod = ins[i]->lod()[0]; + auto& x_lod = ins[i]->lod()[0]; #ifdef PADDLE_WITH_MKLML #pragma omp parallel for #endif @@ -193,10 +193,9 @@ class FusedSeqpoolCVMWithConvGradOpXPUKernel : public framework::OpKernel { } T* dx_data = dx->mutable_data(place); T* dy_data = const_cast(dy->data()); - auto lod = dx->lod(); cpu_dx_list[k] = dx_data; cpu_dy_list[k] = (const T*)dy_data; - auto lod_level_0 = dx->lod()[0]; + auto& lod_level_0 = dx->lod()[0]; int lod_size = lod_level_0.size(); for (int i = 0; i < lod_size; i++) { cpu_lodx[i + start_index] = lod_level_0[i]; diff --git a/paddle/fluid/operators/fused/fused_seqpool_cvm_with_diff_thres_op_xpu.cc b/paddle/fluid/operators/fused/fused_seqpool_cvm_with_diff_thres_op_xpu.cc index a25be0656254b..fd997872147b6 100644 --- a/paddle/fluid/operators/fused/fused_seqpool_cvm_with_diff_thres_op_xpu.cc +++ b/paddle/fluid/operators/fused/fused_seqpool_cvm_with_diff_thres_op_xpu.cc @@ -120,7 +120,7 @@ class FusedSeqpoolCVMWithDiffThresOpXPUKernel : public framework::OpKernel { } else { cpu_y_addr_vec[i] = reinterpret_cast(out[i]->mutable_data(place)); } - auto x_lod = ins[i]->lod()[0]; + auto& x_lod = ins[i]->lod()[0]; #ifdef PADDLE_WITH_MKLML #pragma omp parallel for #endif @@ -213,10 +213,9 @@ class FusedSeqpoolCVMWithDiffThresGradOpXPUKernel : public framework::OpKernelmutable_data(place); // T* dx_data = dx->mutable_data(place); T* dy_data = const_cast(dy->data()); - auto lod = dx->lod(); cpu_dx_list[k] = dx_data; cpu_dy_list[k] = (const T*)dy_data; - auto lod_level_0 = dx->lod()[0]; + auto& lod_level_0 = dx->lod()[0]; int lod_size = lod_level_0.size(); for (int i = 0; i < lod_size; i++) { cpu_lodx[i + start_index] = lod_level_0[i];