From e8e12499a108bfaa9716b6c199ec7b88fc8ea32f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E6=99=93=E4=BC=9F?= <39303645+Shixiaowei02@users.noreply.github.com> Date: Fri, 10 Jan 2020 10:21:52 +0800 Subject: [PATCH] fix multi-thread error of fc_gru_fuse_pass.cc, test=develop (#21841) (#22185) * fix multi-thread error of fc_gru_fuse_pass.cc, test=develop * export FLAGS and GLOG symbols, test=develop --- paddle/fluid/framework/ir/fc_gru_fuse_pass.cc | 8 ++++++-- paddle/fluid/inference/api/demo_ci/vis_demo.cc | 2 +- paddle/fluid/inference/paddle_fluid.map | 5 ++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/framework/ir/fc_gru_fuse_pass.cc b/paddle/fluid/framework/ir/fc_gru_fuse_pass.cc index 287c6dc4072..283c5448896 100644 --- a/paddle/fluid/framework/ir/fc_gru_fuse_pass.cc +++ b/paddle/fluid/framework/ir/fc_gru_fuse_pass.cc @@ -92,8 +92,12 @@ static int BuildFusion(Graph* graph, const std::string& name_scope, } #undef GET_NODE -#define NEW_IMTERMEDIATE_OUT(key) \ - scope.Var(NEW_NAME(key))->GetMutable() +#define NEW_IMTERMEDIATE_OUT(key) \ + VarDesc key(NEW_NAME(key)); \ + key.SetPersistable(false); \ + auto* key##_node = graph->CreateVarNode(&key); \ + IR_NODE_LINK_TO(op, key##_node); + NEW_IMTERMEDIATE_OUT(ReorderedH0); NEW_IMTERMEDIATE_OUT(XX); NEW_IMTERMEDIATE_OUT(BatchedInput); diff --git a/paddle/fluid/inference/api/demo_ci/vis_demo.cc b/paddle/fluid/inference/api/demo_ci/vis_demo.cc index b63e8e62a11..d1435675b8e 100644 --- a/paddle/fluid/inference/api/demo_ci/vis_demo.cc +++ b/paddle/fluid/inference/api/demo_ci/vis_demo.cc @@ -31,7 +31,7 @@ DEFINE_string( "'\t