!12865 [ME]Add restrict of expanding one J node in one optimizer step

From: @chenfei52
Reviewed-by: @ginfung,@zh_qh
Signed-off-by: @zh_qh
pull/12865/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 4742ddfecd

@ -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