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

how to support layer #62

Open
mmdzzh opened this issue Mar 14, 2024 · 1 comment
Open

how to support layer #62

mmdzzh opened this issue Mar 14, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@mmdzzh
Copy link

mmdzzh commented Mar 14, 2024

what should i do if i want to support some layer in this repo and recompile

@Talmaj
Copy link
Owner

Talmaj commented Sep 18, 2024

You should add a new elif condition here to convert the onnx node to pytorch function: https://github.com/Talmaj/onnx2pytorch/blob/v0.5.0/onnx2pytorch/convert/operations.py

Sometimes it's as easy to add a pure pytorch function, but sometimes they differ in implementation and default parameters. In those cases you have to create a new operation under: https://github.com/Talmaj/onnx2pytorch/tree/v0.5.0/onnx2pytorch/operations

You should also include a test for it, best to look at onnx's tests:
https://github.com/onnx/onnx/tree/main/onnx/backend/test/case/node
and example of how that was done for ReduceL2:

@Talmaj Talmaj added the documentation Improvements or additions to documentation label Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants