From 1011f7d38e829d125d5cd6d4e904862b7a696a1a Mon Sep 17 00:00:00 2001 From: Bobholamovic Date: Wed, 10 Aug 2022 17:59:26 +0800 Subject: [PATCH] [Fix] Remove std::trunc() in FloorDivideFunctor and InverseFloorDivideFunctor --- paddle/phi/kernels/funcs/elementwise_functor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/phi/kernels/funcs/elementwise_functor.h b/paddle/phi/kernels/funcs/elementwise_functor.h index e30ab8716b608..476b30ec8f370 100644 --- a/paddle/phi/kernels/funcs/elementwise_functor.h +++ b/paddle/phi/kernels/funcs/elementwise_functor.h @@ -21,7 +21,7 @@ limitations under the License. */ #if defined(__xpu__) #include -#include "xpu/kernel/math_xpu2.h" //pow() +#include "xpu/kernel/math_xpu2.h" // pow() #endif namespace phi { @@ -557,7 +557,7 @@ struct FloorDivideFunctor { #ifndef PADDLE_WITH_XPU_KP PADDLE_ENFORCE(b != 0, DIV_ERROR_INFO); #endif - return static_cast(std::trunc(a / b)); + return static_cast(a / b); } }; @@ -567,7 +567,7 @@ struct InverseFloorDivideFunctor { #ifndef PADDLE_WITH_XPU_KP PADDLE_ENFORCE(a != 0, DIV_ERROR_INFO); #endif - return static_cast(std::trunc(b / a)); + return static_cast(b / a); } };