Skip to content

Commit 583e21e

Browse files
committed
fix mac compie
1 parent 0148d8d commit 583e21e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

paddle/fluid/framework/ir/attention_lstm_fuse_pass.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
// limitations under the License.
1414

1515
#include "paddle/fluid/framework/ir/attention_lstm_fuse_pass.h"
16+
17+
#include <string>
18+
1619
#include "paddle/fluid/framework/ir/graph_pattern_detector.h"
1720
#include "paddle/fluid/framework/ir/graph_viz_pass.h"
1821
#include "paddle/fluid/framework/lod_tensor.h"
@@ -216,11 +219,11 @@ void PrepareLSTMWeight(const LoDTensor& W_forget_w0,
216219

217220
float* out_data = out->mutable_data<float>(platform::CPUPlace());
218221
std::array<const float*, 4> tensors(
219-
{W_forget_w0.data<float>(), W_input_w0.data<float>(),
220-
W_output_w0.data<float>(), W_cell_w0.data<float>()});
222+
{{W_forget_w0.data<float>(), W_input_w0.data<float>(),
223+
W_output_w0.data<float>(), W_cell_w0.data<float>()}});
221224
std::array<const float*, 4> tensors1(
222-
{W_forget_w1.data<float>(), W_input_w1.data<float>(),
223-
W_output_w1.data<float>(), W_cell_w1.data<float>()});
225+
{{W_forget_w1.data<float>(), W_input_w1.data<float>(),
226+
W_output_w1.data<float>(), W_cell_w1.data<float>()}});
224227

225228
for (int row = 0; row < D; row++) {
226229
for (int col = 0; col < 4; col++) {
@@ -243,8 +246,8 @@ void PrepareLSTMBias(const LoDTensor& B_forget, const LoDTensor& B_input,
243246
const LoDTensor& B_output, const LoDTensor& B_cell,
244247
LoDTensor* out) {
245248
std::array<const float*, 4> tensors(
246-
{B_forget.data<float>(), B_input.data<float>(), B_output.data<float>(),
247-
B_cell.data<float>()});
249+
{{B_forget.data<float>(), B_input.data<float>(), B_output.data<float>(),
250+
B_cell.data<float>()}});
248251

249252
PADDLE_ENFORCE_EQ(B_forget.dims().size(), 1);
250253
int D = B_forget.dims()[0];

paddle/fluid/framework/ir/graph.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ class Graph {
167167
std::map<std::string, std::function<void(void)>> attr_dels_;
168168
std::map<ir::Node *, std::unique_ptr<ir::Node>> nodes_;
169169
std::unordered_set<ir::Node *> node_set_;
170-
int node_count_{0};
171170
};
172171

173172
bool IsControlDepVar(const ir::Node &var);

0 commit comments

Comments
 (0)