提交 ab3543e3 编写于 作者: X xuwei06

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.
上级 3f5705c3
...@@ -44,7 +44,7 @@ class ConcatFunctor<platform::CPUDeviceContext, T> { ...@@ -44,7 +44,7 @@ class ConcatFunctor<platform::CPUDeviceContext, T> {
out_cols += t_cols; out_cols += t_cols;
input_cols[i] = t_cols; input_cols[i] = t_cols;
} }
auto& cpu_place = boost::get<platform::CPUPlace>(context.GetPlace()); auto cpu_place = boost::get<platform::CPUPlace>(context.GetPlace());
// computation // computation
for (int k = 0; k < out_rows; ++k) { for (int k = 0; k < out_rows; ++k) {
...@@ -87,7 +87,7 @@ class ConcatGradFunctor<platform::CPUDeviceContext, T> { ...@@ -87,7 +87,7 @@ class ConcatGradFunctor<platform::CPUDeviceContext, T> {
input_cols += t_cols; input_cols += t_cols;
output_cols[i] = t_cols; output_cols[i] = t_cols;
} }
auto& cpu_place = boost::get<platform::CPUPlace>(context.GetPlace()); auto cpu_place = boost::get<platform::CPUPlace>(context.GetPlace());
// computation // computation
for (int k = 0; k < input_rows; ++k) { for (int k = 0; k < input_rows; ++k) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册