From ef0eb526fa07e309c511b2a994c103157846d72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Fri, 10 Mar 2023 16:22:19 +0800 Subject: [PATCH] [phi] add register of angle (#51314) * delete something in interpreter_util.cc * rollback * add REGISTER of angle * bug fix * fix something * Update paddle/phi/kernels/gpu/angle_kernel.cu * Update paddle/phi/kernels/cpu/angle_kernel.cc * Update paddle/phi/kernels/gpu/angle_kernel.cu * Update paddle/phi/kernels/cpu/angle_kernel.cc --- .../framework/new_executor/interpreter/interpreter_util.cc | 1 - paddle/phi/kernels/cpu/angle_kernel.cc | 4 +++- paddle/phi/kernels/gpu/angle_kernel.cu | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc b/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc index b93ef729079..af08155a315 100644 --- a/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc +++ b/paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc @@ -55,7 +55,6 @@ static std::set OpsNeedSetOutputDtypeWhenRegisterPhiKernel = { "adamw", "all_close", "all_raw", - "angle", "any_raw", "arg_sort", "atan2", diff --git a/paddle/phi/kernels/cpu/angle_kernel.cc b/paddle/phi/kernels/cpu/angle_kernel.cc index dc994f763cb..bcca37334cf 100644 --- a/paddle/phi/kernels/cpu/angle_kernel.cc +++ b/paddle/phi/kernels/cpu/angle_kernel.cc @@ -26,4 +26,6 @@ PD_REGISTER_KERNEL(angle, float, double, phi::dtype::complex, - phi::dtype::complex) {} + phi::dtype::complex) { + kernel->OutputAt(0).SetDataType(phi::DataType::UNDEFINED); +} diff --git a/paddle/phi/kernels/gpu/angle_kernel.cu b/paddle/phi/kernels/gpu/angle_kernel.cu index 237d97de219..7c64e784e27 100644 --- a/paddle/phi/kernels/gpu/angle_kernel.cu +++ b/paddle/phi/kernels/gpu/angle_kernel.cu @@ -26,4 +26,6 @@ PD_REGISTER_KERNEL(angle, float, double, phi::dtype::complex, - phi::dtype::complex) {} + phi::dtype::complex) { + kernel->OutputAt(0).SetDataType(phi::DataType::UNDEFINED); +} -- GitLab