未验证 提交 2e1fb26b 编写于 作者: A Aurelius84 提交者: GitHub

[Performance]Add static inline for MakeReturnPyObject (#42334)

上级 b972b0df
...@@ -177,7 +177,7 @@ static inline void HandleViewBetweenInputAndOutput( ...@@ -177,7 +177,7 @@ static inline void HandleViewBetweenInputAndOutput(
} }
} }
PyObject* MakeReturnPyObject( static inline PyObject* MakeReturnPyObject(
const std::shared_ptr<paddle::imperative::VarBase>& out) { const std::shared_ptr<paddle::imperative::VarBase>& out) {
return ::pybind11::detail::type_caster_base<imperative::VarBase>::cast_holder( return ::pybind11::detail::type_caster_base<imperative::VarBase>::cast_holder(
::pybind11::detail::holder_helper< ::pybind11::detail::holder_helper<
...@@ -186,7 +186,7 @@ PyObject* MakeReturnPyObject( ...@@ -186,7 +186,7 @@ PyObject* MakeReturnPyObject(
.ptr(); .ptr();
} }
PyObject* MakeReturnPyObject( static inline PyObject* MakeReturnPyObject(
const std::vector<std::shared_ptr<imperative::VarBase>>& out) { const std::vector<std::shared_ptr<imperative::VarBase>>& out) {
PyObject* result = PyList_New((Py_ssize_t)out.size()); PyObject* result = PyList_New((Py_ssize_t)out.size());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册