!30804 [MSLITE] Fix bug of mindir converter.

Merge pull request !30804 from wangshaocong/bugfix_r1.6
This commit is contained in:
i-robot 2022-03-03 12:01:33 +00:00 committed by Gitee
commit 3c2ecf6a37
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 2 deletions

View File

@ -469,6 +469,9 @@ AbstractBasePtr GetCNodeInputAbstract(const CNodePtr &cnode, size_t index) {
if (utils::isa<ParameterPtr>(input)) {
auto parameter = input->cast<ParameterPtr>();
abstract = parameter->abstract();
} else if (utils::isa<ValueNodePtr>(input)) {
auto value_node = input->cast<ValueNodePtr>();
abstract = value_node->abstract();
} else if (utils::isa<CNodePtr>(input)) {
auto input_cnode = input->cast<CNodePtr>();
if (CheckPrimitiveType(input_cnode, prim::kPrimTupleGetItem)) {

View File

@ -255,8 +255,8 @@ int RemoveRedundantOpPass::RemoveDropoutOp(const AnfNodePtr &anf_node, const Fun
}
auto get_index = CastToInt(get_index_node->value()).front();
if (get_index > 0 && !manager->node_users()[node].empty()) {
MS_LOG(ERROR) << "dropout's second output is useful.";
return lite::RET_ERROR;
MS_LOG(DEBUG) << "dropout's second output is useful.";
continue;
}
manager->Replace(node, cnode->input(1));
}