提交 ee5b406b 编写于 作者: S simson

rebuild graph before rungraph if needed

上级 e6ea0908
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册