!22 use string::find instead of equal to distinguish training graph

Merge pull request !22 from chenhaozhe/enable-variable-acc-for-training-graph
This commit is contained in:
mindspore-ci-bot 2020-04-07 19:07:41 +08:00 committed by Gitee
commit 9c8a0b7f7e
1 changed files with 1 additions and 1 deletions

View File

@ -1071,7 +1071,7 @@ bool ExecutorPy::AddDFGraph(const py::dict& init_params, const std::string& phas
}
std::string init_graph = "init_subgraph." + net_id;
std::string checkpoint_name = "save." + net_id;
if (phase == "train") {
if (phase.find("train") != std::string::npos) {
(void)DfGraphManager::GetInstance().AddGraph(phase, convertor.GetComputeGraph(), {{"ge.exec.variable_acc", "1"}});
} else {
(void)DfGraphManager::GetInstance().AddGraph(phase, convertor.GetComputeGraph());