onnx / tutorials

Tutorials for creating and using ONNX models
Apache License 2.0
3.34k stars 626 forks source link

Export Python functions to ONNX as a single op #235

Open gyenesvi opened 3 years ago

gyenesvi commented 3 years ago

Ask a Question

Question

I have seen some (experimental?) support in ONNX proto to functions (sequence of ops). Is it actually supported by ONNX latest version, or was it just experimental? How can I export a PyTorch model with such a function in it?

Further information

Notes

For example, when exporting a ShuffleNet, it would be good to have the shuffle ops as a single op/a function so that it is easier on the importer side to understand which ops form a higher level compound. For small functions like the shuffle op, it could be merged on the importer side, but such practice becomes prohibitive for larger functions.

jcwchen commented 3 years ago

Should be solved by https://github.com/onnx/onnx/issues/3286. Thanks.