diff --git a/paddle/fluid/memory/allocation/memory_block.h b/paddle/fluid/memory/allocation/memory_block.h index ee634e272d002c60ec3452ae6bd4472ef7dd37e0..1ddf88ce8b47cdbf4bfb30723ef1eb09f888b44c 100644 --- a/paddle/fluid/memory/allocation/memory_block.h +++ b/paddle/fluid/memory/allocation/memory_block.h @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once +#include #include #include diff --git a/paddle/fluid/pybind/eager_utils.cc b/paddle/fluid/pybind/eager_utils.cc index 4f0b9296db333f809f31dd1d1ea444c406230bc8..895a715c8bad82c9490bede76f2b97a8f62838f3 100644 --- a/paddle/fluid/pybind/eager_utils.cc +++ b/paddle/fluid/pybind/eager_utils.cc @@ -761,7 +761,7 @@ PyObject* ToPyObject(const void* value) { PyObject* ToPyObject( const std::unordered_map>& value) { PyObject* dict = PyDict_New(); - for (const auto map_iter : value) { + for (const auto& map_iter : value) { // Convert Key PyObject* key_string = PyUnicode_FromString(map_iter.first.c_str()); if (!key_string) { @@ -771,7 +771,7 @@ PyObject* ToPyObject( // Convert Val PyObject* py_list = PyList_New(0); - for (const auto vector_iter : map_iter.second) { + for (const auto& vector_iter : map_iter.second) { PyObject* val_string = PyUnicode_FromString(vector_iter.c_str()); if (!val_string) { PADDLE_THROW(platform::errors::Fatal( @@ -798,7 +798,7 @@ PyObject* ToPyObject( PyObject* ToPyObject(const std::unordered_map& value) { PyObject* dict = PyDict_New(); - for (const auto map_iter : value) { + for (const auto& map_iter : value) { // Convert Key PyObject* key_string = PyUnicode_FromWideChar(map_iter.first.c_str(), map_iter.first.size());