diff --git a/paddle/phi/kernels/xpu/distribute_fpn_proposals_kernel.cc b/paddle/phi/kernels/xpu/distribute_fpn_proposals_kernel.cc index e78a501b6a47e66252d596e608b8139ada6cbd06..f72a3c8748632329c5fa083920bc3a477ffb6f77 100644 --- a/paddle/phi/kernels/xpu/distribute_fpn_proposals_kernel.cc +++ b/paddle/phi/kernels/xpu/distribute_fpn_proposals_kernel.cc @@ -49,7 +49,7 @@ static void Sort(const XPUContext& dev_ctx, return scores_slice_cpu_data[i] < scores_slice_cpu_data[j]; }; - std::sort(index, index + value.numel(), compare); + std::stable_sort(index, index + value.numel(), compare); index_out->Resize({index_t.numel()}); int* idx_out = dev_ctx.template Alloc(index_out); memory_utils::Copy( @@ -108,7 +108,7 @@ void DistributeFpnProposalsKernel( xpu::VectorParam rois_lod = { rois_lod_vec.data(), static_cast(rois_lod_vec.size()), nullptr}; - int r = xpu::distribute_fpn_proposals_helper( + int r = xpu::distribute_fpn_proposals_helper( dev_ctx.x_context(), reinterpret_cast(fpn_rois.data()), rois_lod, @@ -158,7 +158,7 @@ void DistributeFpnProposalsKernel( fpn_rois_shape, sub_idx.numel(), 0); - PADDLE_ENFORCE_XDNN_SUCCESS(r1, "distribute_fpn_proposals_helper"); + PADDLE_ENFORCE_XDNN_SUCCESS(r1, "gather"); } else { multi_fpn_rois[i]->Resize({sub_rois_num, funcs::kBoxDim}); dev_ctx.template Alloc(multi_fpn_rois[i]);