webonnx / wonnx

A WebGPU-accelerated ONNX inference run-time written 100% in Rust, ready for native and the web
Other
1.54k stars 54 forks source link

How to handle dynamic dimension tensors #196

Open xd009642 opened 7 months ago

xd009642 commented 7 months ago

This wasn't clear from the docs or the API types. In Session::run InputTensor and OutputTensor are used for inference but these only contain 1D values and no way to provide a shape for the tensor. If I have dynamic axes (batch size, sequence length etc). How can I specify the shape and also for the output get the output shape (which is also dynamic)?