diff --git a/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc b/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc index e15fd1bc1a3ef706b908717b6407237a3be57722..0c228abf9a9c74dddee930be1a97e52dab22a9ca 100644 --- a/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc +++ b/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc @@ -74,7 +74,6 @@ static std::set OpsNeedSetOutputDtypeWhenRegisterPhiKernel = { "less_equal", "less_than", "merged_adam", - "mode", "momentum", "multiclass_nms3", "multinomial", diff --git a/paddle/phi/kernels/cpu/mode_kernel.cc b/paddle/phi/kernels/cpu/mode_kernel.cc index 762c146e7352f5c84cfd503481ef14340c16d104..352f5d0b69e05ca52d7d2b3b90e1ede3e847db11 100644 --- a/paddle/phi/kernels/cpu/mode_kernel.cc +++ b/paddle/phi/kernels/cpu/mode_kernel.cc @@ -132,4 +132,6 @@ void ModeKernel(const Context& dev_ctx, } // namespace phi PD_REGISTER_KERNEL( - mode, CPU, ALL_LAYOUT, phi::ModeKernel, float, double, int32_t, int64_t) {} + mode, CPU, ALL_LAYOUT, phi::ModeKernel, float, double, int32_t, int64_t) { + kernel->OutputAt(1).SetDataType(phi::DataType::INT64); +} diff --git a/paddle/phi/kernels/gpu/mode_kernel.cu b/paddle/phi/kernels/gpu/mode_kernel.cu index 815ecb9e1a787a5bbbb8ba1537741258f5e2d418..c834d87aca9cb0772b90d31a0f5f9e7f4206605d 100644 --- a/paddle/phi/kernels/gpu/mode_kernel.cu +++ b/paddle/phi/kernels/gpu/mode_kernel.cu @@ -130,4 +130,6 @@ void ModeKernel(const Context& dev_ctx, } // namespace phi PD_REGISTER_KERNEL( - mode, GPU, ALL_LAYOUT, phi::ModeKernel, float, double, int32_t, int64_t) {} + mode, GPU, ALL_LAYOUT, phi::ModeKernel, float, double, int32_t, int64_t) { + kernel->OutputAt(1).SetDataType(phi::DataType::INT64); +}