Browse Source

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

Merge pull request !30 from chenhaozhe/enable-variable-acc-for-training-graph
tags/v0.2.0-alpha
mindspore-ci-bot Gitee 5 years ago
parent
commit
02a25407c4
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mindspore/ccsrc/pipeline/pipeline.cc

+ 1
- 1
mindspore/ccsrc/pipeline/pipeline.cc View File

@@ -1104,7 +1104,7 @@ bool ExecutorPy::AddDFGraph(const py::dict& init_params, const std::string& phas
} }
std::string init_graph = "init_subgraph." + net_id; std::string init_graph = "init_subgraph." + net_id;
std::string checkpoint_name = "save." + 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"}}); (void)DfGraphManager::GetInstance().AddGraph(phase, convertor.GetComputeGraph(), {{"ge.exec.variable_acc", "1"}});
} else { } else {
(void)DfGraphManager::GetInstance().AddGraph(phase, convertor.GetComputeGraph()); (void)DfGraphManager::GetInstance().AddGraph(phase, convertor.GetComputeGraph());


Loading…
Cancel
Save