Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnnx pytorch 1.13 #4314

Merged
merged 1 commit into from
Oct 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/pnnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
- torch-version: 1.12.0
torchvision-version: 0.13.0

- torch-version: 1.13.0
torchvision-version: 0.14.0

steps:
- uses: actions/checkout@v3
with:
Expand Down
23 changes: 23 additions & 0 deletions tools/pnnx/src/pass_level2/F_upsample_nearest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,29 @@ pnnx.Output output 1 0 out

REGISTER_GLOBAL_PNNX_GRAPH_REWRITER_PASS(F_upsample_nearest_1, 10)

class F_upsample_nearest_1_1 : public GraphRewriterPass
{
public:
const char* match_pattern_graph() const
{
return R"PNNXIR(7767517
5 4
pnnx.Input input_0 0 1 input
pnnx.Input input_1 0 1 size
prim::Constant op_0 0 1 scale_factor value=None
aten::upsample_nearest2d op_1 3 1 input size scale_factor out
pnnx.Output output 1 0 out
)PNNXIR";
}

const char* type_str() const
{
return "F.upsample_nearest";
}
};

REGISTER_GLOBAL_PNNX_GRAPH_REWRITER_PASS(F_upsample_nearest_1_1, 10)

class F_upsample_nearest_2 : public GraphRewriterPass
{
public:
Expand Down
23 changes: 23 additions & 0 deletions tools/pnnx/src/pass_level2/torch_einsum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,27 @@ pnnx.Output output 1 0 out

REGISTER_GLOBAL_PNNX_GRAPH_REWRITER_PASS(torch_einsum, 20)

class torch_einsum_1 : public GraphRewriterPass
{
public:
const char* match_pattern_graph() const
{
return R"PNNXIR(7767517
5 4
pnnx.Input input_0 0 1 equation
pnnx.Input input_1 0 1 operands
prim::Constant op_0 0 1 path value=None
aten::einsum op_1 3 1 equation operands path out
pnnx.Output output 1 0 out
)PNNXIR";
}

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

REGISTER_GLOBAL_PNNX_GRAPH_REWRITER_PASS(torch_einsum_1, 20)

} // namespace pnnx