polish global_value_getter_setter, test=develop (#21332)

revert-21172-masked_select_api
Zeng Jinle 6 years ago committed by GitHub
parent a214a3081b
commit dbba9c7e4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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(

Loading…
Cancel
Save