From f5956becb378ed34154bec5b1b6781518c1cc840 Mon Sep 17 00:00:00 2001 From: Lin Manhui Date: Thu, 29 Sep 2022 11:07:20 +0800 Subject: [PATCH] [CherryPick][Fix] Remove std::trunc() in FloorDivideFunctor and InverseFloorDivideFunctor (#45051) (#46504) --- 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 a4636565cf..1304fedbd2 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