From 091ae705e792450629f13ec54207600ea3612092 Mon Sep 17 00:00:00 2001 From: Lin Manhui Date: Mon, 26 Sep 2022 16:55:18 +0800 Subject: [PATCH] [Fix] Remove std::trunc() in FloorDivideFunctor and InverseFloorDivideFunctor (#45051) --- paddle/phi/kernels/funcs/elementwise_functor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/phi/kernels/funcs/elementwise_functor.h b/paddle/phi/kernels/funcs/elementwise_functor.h index a4636565cf2..1304fedbd2e 100644 --- a/paddle/phi/kernels/funcs/elementwise_functor.h +++ b/paddle/phi/kernels/funcs/elementwise_functor.h @@ -570,7 +570,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); } }; @@ -580,7 +580,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); } }; -- GitLab