Course: Neural Network Engine (NNE)

Hi @Localerhorst ,

Dynamic shape support is neither limited by NNE nor the ONNX file format, but the runtime you are using. (Both NNE and ONNX just define dynamic shapes by symbols, it is up to the runtime to interprete/fill them).

However: there are two kinds of ‘dynamic shapes’:

One is when the output shape depends on the shape of your input (e.g. you can change your batch size in the input and it will change the batch size of the output) which is supported by the Onnxruntime that you are using.

The other one is, if the output shape depends on the content of your input, which seems to be the case in your model. This is typically more difficult to handle by the runtimes and thus @HelloJXY suggestion is the most robust you can do.

2 Likes