nbigaouette / onnxruntime-rs

Rust wrapper for Microsoft's ONNX Runtime (version 1.8)
Apache License 2.0
276 stars 99 forks source link

Support for multiple types in the model inputs #98

Closed eublefar closed 1 year ago

eublefar commented 2 years ago

I have wrapped ndarray::Array into an enum InputTensor with variants containing specific ndarray element types. I have modified Session to use this InputTensor enum along with match expression to destructure enum into ndarray::Array.

This change is not backward compatible. Probably could be implemented in backward compatible way with some trait bounding magic or additional run method but I am not sure what could be the best way to do it.