未验证 提交 150ca413 编写于 作者: N niuliling123 提交者: GitHub

Modified stack_limit from param to flag (#54159)

上级 12c15b89
...@@ -41,7 +41,7 @@ limitations under the License. */ ...@@ -41,7 +41,7 @@ limitations under the License. */
#include "paddle/phi/core/flags.h" #include "paddle/phi/core/flags.h"
PHI_DECLARE_bool(check_nan_inf); PHI_DECLARE_bool(check_nan_inf);
PHI_DECLARE_int32(check_nan_inf_level);
namespace paddle { namespace paddle {
namespace pybind { namespace pybind {
...@@ -221,7 +221,7 @@ std::shared_ptr<imperative::VarBase> CastPyArg2VarBase(PyObject* obj, ...@@ -221,7 +221,7 @@ std::shared_ptr<imperative::VarBase> CastPyArg2VarBase(PyObject* obj,
} }
void SetPythonStack() { void SetPythonStack() {
if (FLAGS_check_nan_inf) { if (FLAGS_check_nan_inf && FLAGS_check_nan_inf_level == 0) {
VLOG(4) << "this is SetPythonStack"; VLOG(4) << "this is SetPythonStack";
pybind11::gil_scoped_acquire gil; pybind11::gil_scoped_acquire gil;
PyObject* mod = PyImport_ImportModule("traceback"); PyObject* mod = PyImport_ImportModule("traceback");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册