From dbba9c7e4b69cce019cee81a8d90d5ce2bd26b06 Mon Sep 17 00:00:00 2001 From: Zeng Jinle <32832641+sneaxiy@users.noreply.github.com> Date: Tue, 26 Nov 2019 12:10:43 +0800 Subject: [PATCH] polish global_value_getter_setter, test=develop (#21332) --- paddle/fluid/pybind/global_value_getter_setter.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/pybind/global_value_getter_setter.cc b/paddle/fluid/pybind/global_value_getter_setter.cc index 108764f9bfb..10c9fb8bdbe 100644 --- a/paddle/fluid/pybind/global_value_getter_setter.cc +++ b/paddle/fluid/pybind/global_value_getter_setter.cc @@ -81,7 +81,7 @@ class PYBIND11_HIDDEN GlobalVarGetterSetterRegistry { } py::object GetOrReturnDefaultValue(const std::string &name, - const py::object &default_value) { + const py::object &default_value) const { if (HasGetterMethod(name)) { return GetterMethod(name)(); } else { @@ -89,7 +89,7 @@ class PYBIND11_HIDDEN GlobalVarGetterSetterRegistry { } } - py::object Get(const std::string &name) { return GetterMethod(name)(); } + py::object Get(const std::string &name) const { return GetterMethod(name)(); } const Setter &SetterMethod(const std::string &name) const { PADDLE_ENFORCE_EQ( -- GitLab