Skip to content

Commit

Permalink
w
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Feb 8, 2025
1 parent 4da1b67 commit 8409c77
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tools/pnnx/src/pass_level2/torch_clamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,25 @@ pnnx.Output output 1 0 out

REGISTER_GLOBAL_PNNX_GRAPH_REWRITER_PASS(torch_clamp_onnx_2, 40)

class torch_clamp_tnn : public GraphRewriterPass
{
public:
const char* match_pattern_graph() const
{
return R"PNNXIR(7767517
3 2
pnnx.Input input 0 1 input
tnn.Clip op_0 1 1 input out arg0=%min arg1=%max
pnnx.Output output 1 0 out
)PNNXIR";
}

const char* type_str() const
{
return "torch.clamp";
}
};

REGISTER_GLOBAL_PNNX_GRAPH_REWRITER_PASS(torch_clamp_tnn, 40)

} // namespace pnnx

0 comments on commit 8409c77

Please sign in to comment.