daquexian / onnx-simplifier

Simplify your onnx model
Apache License 2.0
3.67k stars 377 forks source link

[Request] Preserve input value_info for custom ops #327

Open jchia opened 3 months ago

jchia commented 3 months ago

onnxsim is unable to do shape inference for custom op nodes that are not registered with onnxruntime and their downstream nodes. Making the shape inference work entails detailed C++ work for the custom op. (#284)

Can onnxsim be changed to allowing preserving value_info from the input graph, especially for custom op nodes for which it can't do shape inference? This is helpful especially for cases where input shape is static and the user can easily determine and provide the shape for the custom op outputs in the input model. This way, the user does not need understand how to write the arcane C++ code needed for custom ops.