onnx / optimizer

Actively maintained ONNX Optimizer
Apache License 2.0
650 stars 90 forks source link

-1 mean dynamic shape or Static shape? #100

Closed xiaobochen123 closed 1 year ago

xiaobochen123 commented 2 years ago

-1 mean what? dynamic shape or Static shape? Using the latest version(v0.3.1), -1 dim will be constant fold. In old version, It doesn't fold. So that cause some conflict.

HSQ79815 commented 2 years ago

-1 means dynamic shape. In the latest version,we add some passes that can fold or fuse dynamic shape.

daquexian commented 1 year ago

Update: according to ONNX spec, "-1" is not a dynamic shape, and is not accepted by onnx backends like onnxruntime. If your model contains "-1" as a shape, please post an issue in the repo of the exporter you used.

Related issue of PaddlePaddle: https://github.com/PaddlePaddle/Paddle2ONNX/issues/928