diff --git a/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc b/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc index b837c24c4fe7d47e24a498fc034de5e1824bedad..b2ef8c2f7dca37b910dc7e88be590b2fc15feec5 100644 --- a/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc +++ b/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc @@ -65,7 +65,6 @@ static std::set OpsNeedSetOutputDtypeWhenRegisterPhiKernel = { "generate_proposals", "graph_sample_neighbors", "group_norm", - "histogram", "instance_norm", "lamb", "layer_norm", diff --git a/paddle/phi/infermeta/unary.cc b/paddle/phi/infermeta/unary.cc index 68d2231b2fa0dba28826be94acb8b37c023f9bc0..b2edfd5a2aef1ce3a592776abb53a89ef3a859cd 100644 --- a/paddle/phi/infermeta/unary.cc +++ b/paddle/phi/infermeta/unary.cc @@ -1626,6 +1626,7 @@ void HistogramInferMeta( out->set_dims({bins}); out->share_lod(input); + out->set_dtype(DataType::INT64); } void IdentityLossInferMeta(const MetaTensor& x, diff --git a/paddle/phi/kernels/cpu/histogram_kernel.cc b/paddle/phi/kernels/cpu/histogram_kernel.cc index 4c04566b8b0b0789463b4bdd6247b2914559192a..030dee9908b31c6bd08728ba0522d2a2b8bb659f 100644 --- a/paddle/phi/kernels/cpu/histogram_kernel.cc +++ b/paddle/phi/kernels/cpu/histogram_kernel.cc @@ -85,4 +85,6 @@ PD_REGISTER_KERNEL(histogram, float, double, int, - int64_t) {} + int64_t) { + kernel->OutputAt(0).SetDataType(paddle::DataType::INT64); +} diff --git a/paddle/phi/kernels/gpu/histogram_kernel.cu b/paddle/phi/kernels/gpu/histogram_kernel.cu index cdcd70363dc78a2da017a4a6e2acccf6b6c5b4f4..111b13f11dd0ef462d0ba8cca73f14a4f5cbe46b 100644 --- a/paddle/phi/kernels/gpu/histogram_kernel.cu +++ b/paddle/phi/kernels/gpu/histogram_kernel.cu @@ -154,4 +154,6 @@ PD_REGISTER_KERNEL(histogram, float, double, int, - int64_t) {} + int64_t) { + kernel->OutputAt(0).SetDataType(paddle::DataType::INT64); +}