Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build errors with gcc-11 #46808

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions paddle/fluid/memory/allocation/memory_block.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#pragma once

#include <cstddef>
#include <cstdint>
#include <unordered_map>

Expand Down
6 changes: 3 additions & 3 deletions paddle/fluid/pybind/eager_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ PyObject* ToPyObject(const void* value) {
PyObject* ToPyObject(
const std::unordered_map<std::string, std::vector<std::string>>& 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) {
Expand All @@ -773,7 +773,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(
Expand All @@ -800,7 +800,7 @@ PyObject* ToPyObject(

PyObject* ToPyObject(const std::unordered_map<std::wstring, int>& 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());
Expand Down