[MSLITE] fix bug of mindir converter

This commit is contained in:
wangshaocong 2022-03-02 09:29:29 +08:00
parent f1c1acd681
commit c4ab795423
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));
}