Browse Source

!175 Rebuild graph before RunGraph if needed

Merge pull request !175 from Simson/rebuild-graph-before-RunGraph
tags/v0.2.0-alpha
mindspore-ci-bot Gitee 5 years ago
parent
commit
dd9a5a385a
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      mindspore/ccsrc/transform/graph_runner.cc

+ 7
- 0
mindspore/ccsrc/transform/graph_runner.cc View File

@@ -138,6 +138,13 @@ Status GraphRunner::RunGraph(const RunOptions& options, const std::vector<GeTens
return Status::FAILED;
}

// The information of some nodes could be changed after fusion in some cases
// Therefore a graph needs to be rebuilt in above situation
if (sess_->IsGraphNeedRebuild(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;


Loading…
Cancel
Save