Browse Source

return if is_once_ is true

tags/v1.2.0-rc1
chenfei 5 years ago
parent
commit
74605a9f22
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      mindspore/ccsrc/frontend/optimizer/opt.cc

+ 6
- 0
mindspore/ccsrc/frontend/optimizer/opt.cc View File

@@ -184,6 +184,9 @@ bool SubstitutionList::ApplyIRToSubstitutions(const OptimizerPtr &optimizer, con
for (auto &substitution : list_) {
auto res = DoTransform(optimizer, node, substitution);
if (res != nullptr) {
if (is_once_) {
return true;
}
change = true;
changes = true;
node = res;
@@ -229,6 +232,9 @@ bool SubstitutionList::ApplySubstitutionToIR(const OptimizerPtr &optimizer, cons
changes = true;
node = res;
}
if (change && is_once_) {
return true;
}
UpdateTransformingList(optimizer, node, &todo, change, seen);
}



Loading…
Cancel
Save