confusion about shape inference #2819
Replies: 3 comments
-
Hi @Channingss, on the line you point to you can see the Lines 32 to 39 in 925b365 Shape inference does support named (non-concrete) dimensions, but you're right it doesn't do any symbolic manipulation (e.g. 2*x). However, ONNX Runtime has a shape inference script for their Nuphar provider which does do symbolic shape inference, so you can use that if you need. |
Beta Was this translation helpful? Give feedback.
-
thanks for your reply, I export a Bert model from this repo:https://github.com/huggingface/transformers/blob/master/notebooks/04-onnx-export.ipynb |
Beta Was this translation helpful? Give feedback.
-
If you dig into the code a little you can see they are providing a list of You can find the documentation for that function here. Does this cause any issues for you @Channingss, or are you just curious? 🙂 |
Beta Was this translation helpful? Give feedback.
-
TypeAndShapeInferenceFunction
of Mul, of course some other OPs too, which means some OPs don't have realizition of shape inference?onnx/onnx/defs/math/defs.cc
Line 179 in 925b365
I found this input of model is symbolic(not Int64), through input tensor is given by torch.onnx,export, and shape inference of some node is also failed, witch means onnx.shape_inference don't support symbolic shape, right?
Beta Was this translation helpful? Give feedback.
All reactions