未验证 提交 f5956bec 编写于 作者: L Lin Manhui 提交者: GitHub

[CherryPick][Fix] Remove std::trunc() in FloorDivideFunctor and...

[CherryPick][Fix] Remove std::trunc() in FloorDivideFunctor and InverseFloorDivideFunctor (#45051) (#46504)
上级 3f35e634
...@@ -570,7 +570,7 @@ struct FloorDivideFunctor { ...@@ -570,7 +570,7 @@ struct FloorDivideFunctor {
#ifndef PADDLE_WITH_XPU_KP #ifndef PADDLE_WITH_XPU_KP
PADDLE_ENFORCE(b != 0, DIV_ERROR_INFO); PADDLE_ENFORCE(b != 0, DIV_ERROR_INFO);
#endif #endif
return static_cast<T>(std::trunc(a / b)); return static_cast<T>(a / b);
} }
}; };
...@@ -580,7 +580,7 @@ struct InverseFloorDivideFunctor { ...@@ -580,7 +580,7 @@ struct InverseFloorDivideFunctor {
#ifndef PADDLE_WITH_XPU_KP #ifndef PADDLE_WITH_XPU_KP
PADDLE_ENFORCE(a != 0, DIV_ERROR_INFO); PADDLE_ENFORCE(a != 0, DIV_ERROR_INFO);
#endif #endif
return static_cast<T>(std::trunc(b / a)); return static_cast<T>(b / a);
} }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册