fix bug of print scalar, not optimize depend when specializing

This commit is contained in:
fary86 2020-05-22 09:12:44 +08:00
parent 0ca626ef6c
commit 5138c10c6c
1 changed files with 5 additions and 2 deletions

View File

@ -648,9 +648,12 @@ AnfNodePtr FuncGraphSpecializer::BuildPossibleValueNode(const AnfNodePtr &origin
ValuePtr val = ival->BuildValue();
if (val->isa<AnyValue>()) {
return nullptr;
} else {
return BuildValueNode(val, ival);
}
// keep primitive 'depend' not to be optimized
if (IsPrimitiveCNode(origin_node, prim::kPrimDepend)) {
return nullptr;
}
return BuildValueNode(val, ival);
}
}