Skip to content

Commit

Permalink
fix bug of trans_stack2Unsqueeze
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jun 4, 2024
1 parent bacc8f9 commit 10ade66
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/pnnx/src/pass_level6/trans_Stack2Unsqueeze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ void trans_Stack2Unsqueeze(Graph& graph)

if (op->type != "torch.stack")
continue;
matched = true;
// get input num
if( op->inputs.size() == 1)
{
matched = true;
op->type = "torch.unsqueeze";
std::string str = op->name;
std::string from = "torch.stack";
Expand All @@ -47,8 +47,9 @@ void trans_Stack2Unsqueeze(Graph& graph)
str.replace(start_pos, from.length(), to);
}
op->name = str;
break;
}
break;

}

if (!matched)
Expand Down

0 comments on commit 10ade66

Please sign in to comment.