From 03479469a700ce30edea0fe80a7c14982a6082db 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, 27 Dec 2019 13:36:01 +0800 Subject: [PATCH] fix multi-thread error of fc_gru_fuse_pass.cc, test=develop (#21841) * 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 287c6dc407..283c544889 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 b63e8e62a1..d1435675b8 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