From ab3543e35ee84ebbf9fe8c11eda7318f01ab7515 Mon Sep 17 00:00:00 2001 From: xuwei06 Date: Fri, 16 Mar 2018 14:29:49 -0700 Subject: [PATCH] Fix compilation for gcc5.4 The error is: paddle/fluid/operators/math/concat.cc:47:72: error: invalid initialization of non-const reference of type 'paddle::platform::CPUPlace&' from an rvalue of type 'paddle::platform::CPUPlace' auto& cpu_place = boost::get(context.GetPlace()); Should not use reference for cpu_place. --- paddle/fluid/operators/math/concat.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/math/concat.cc b/paddle/fluid/operators/math/concat.cc index b542143419..b672c79afd 100644 --- a/paddle/fluid/operators/math/concat.cc +++ b/paddle/fluid/operators/math/concat.cc @@ -44,7 +44,7 @@ class ConcatFunctor { out_cols += t_cols; input_cols[i] = t_cols; } - auto& cpu_place = boost::get(context.GetPlace()); + auto cpu_place = boost::get(context.GetPlace()); // computation for (int k = 0; k < out_rows; ++k) { @@ -87,7 +87,7 @@ class ConcatGradFunctor { input_cols += t_cols; output_cols[i] = t_cols; } - auto& cpu_place = boost::get(context.GetPlace()); + auto cpu_place = boost::get(context.GetPlace()); // computation for (int k = 0; k < input_rows; ++k) { -- GitLab