From ee5b406b3746d01422000df3abf2b92fe1742d2b Mon Sep 17 00:00:00 2001 From: simson <526422051@qq.com> Date: Wed, 8 Apr 2020 15:19:57 +0800 Subject: [PATCH] rebuild graph before rungraph if needed --- mindspore/ccsrc/transform/graph_runner.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mindspore/ccsrc/transform/graph_runner.cc b/mindspore/ccsrc/transform/graph_runner.cc index f1f270cdb6..51ab7b9922 100644 --- a/mindspore/ccsrc/transform/graph_runner.cc +++ b/mindspore/ccsrc/transform/graph_runner.cc @@ -138,6 +138,13 @@ Status GraphRunner::RunGraph(const RunOptions& options, const std::vectorIsGraphNeedRebuild(wrap_ptr->id_)) { + sess_->RemoveGraph(wrap_ptr->id_); + sess_->AddGraph(wrap_ptr->id_, *(it->graph_ptr_), it->options_); + } + ge::Status ret = sess_->RunGraph(wrap_ptr->id_, ge_inputs, ge_outputs); if (ret != ge::GRAPH_SUCCESS) { MS_LOG(ERROR) << "Call GE RunGraph Failed, ret is: " << ret;