diff --git a/paddle/framework/pybind.cc b/paddle/framework/pybind.cc index 70f0e51573338fd34cbea3e14d1700db8fd08b4f..1f30cb10f62cf019ed8fab78af4ff18151fba72c 100644 --- a/paddle/framework/pybind.cc +++ b/paddle/framework/pybind.cc @@ -154,8 +154,8 @@ All parameter, weight, gradient are variables in Paddle. m.def_submodule( "var_names", "The module will return special predefined variable name in Paddle") - .def("empty", kEmptyVarName) - .def("temp", kTempVarName); + .def("empty", []() { return kEmptyVarName; }) + .def("temp", []() { return kTempVarName; }); // clang-format off py::class_(m, "DeviceContext") .def_static("create",