Skip to content

Commit ab3543e

Browse files
author
xuwei06
committed
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<platform::CPUPlace>(context.GetPlace()); Should not use reference for cpu_place.
1 parent 3f5705c commit ab3543e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paddle/fluid/operators/math/concat.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ConcatFunctor<platform::CPUDeviceContext, T> {
4444
out_cols += t_cols;
4545
input_cols[i] = t_cols;
4646
}
47-
auto& cpu_place = boost::get<platform::CPUPlace>(context.GetPlace());
47+
auto cpu_place = boost::get<platform::CPUPlace>(context.GetPlace());
4848

4949
// computation
5050
for (int k = 0; k < out_rows; ++k) {
@@ -87,7 +87,7 @@ class ConcatGradFunctor<platform::CPUDeviceContext, T> {
8787
input_cols += t_cols;
8888
output_cols[i] = t_cols;
8989
}
90-
auto& cpu_place = boost::get<platform::CPUPlace>(context.GetPlace());
90+
auto cpu_place = boost::get<platform::CPUPlace>(context.GetPlace());
9191

9292
// computation
9393
for (int k = 0; k < input_rows; ++k) {

0 commit comments

Comments
 (0)