diff --git a/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc b/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc index e1857d399b6ce5753aff2945655ba93ce6dd5cf7..e4719cbcf0e14fe65d9b46a96d70fd6ecda8ef53 100644 --- a/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc +++ b/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc @@ -70,7 +70,6 @@ static std::set OpsNeedSetOutputDtypeWhenRegisterPhiKernel = { "merged_adam", "momentum", "multiclass_nms3", - "multinomial", "nanmedian", "sync_batch_norm_grad", "unique", diff --git a/paddle/phi/kernels/cpu/multinomial_kernel.cc b/paddle/phi/kernels/cpu/multinomial_kernel.cc index 1e31b4649fbcc8fd85b6d471679f0094edd51eb2..d1f713db00bd56ad10cb6556eb0ec92cb9743984 100644 --- a/paddle/phi/kernels/cpu/multinomial_kernel.cc +++ b/paddle/phi/kernels/cpu/multinomial_kernel.cc @@ -45,4 +45,6 @@ void MultinomialKernel(const Context& dev_ctx, } // namespace phi PD_REGISTER_KERNEL( - multinomial, CPU, ALL_LAYOUT, phi::MultinomialKernel, float, double) {} + multinomial, CPU, ALL_LAYOUT, phi::MultinomialKernel, float, double) { + kernel->OutputAt(0).SetDataType(phi::DataType::INT64); +} diff --git a/paddle/phi/kernels/gpu/multinomial_kernel.cu b/paddle/phi/kernels/gpu/multinomial_kernel.cu index 2e6e95f4c232ec7281944a1594e8bd302275a8c9..8b1d960527fd7dc784ad2a88202f202c93627142 100644 --- a/paddle/phi/kernels/gpu/multinomial_kernel.cu +++ b/paddle/phi/kernels/gpu/multinomial_kernel.cu @@ -296,6 +296,8 @@ PD_REGISTER_KERNEL(multinomial, // cuda_only ALL_LAYOUT, phi::MultinomialKernel, float, - double) {} + double) { + kernel->OutputAt(0).SetDataType(phi::DataType::INT64); +} #endif