robertknight / rten

ONNX neural network inference engine
127 stars 9 forks source link

serde traits for helper data structures? #179

Closed luketpeterson closed 6 months ago

luketpeterson commented 6 months ago

Hello,

Would you accept a PR that adds an optional feature flag to implement the serde Serialize / Deserialize traits for the types defined in rten? Specifically I am interested in the types in rten_imageproc (Rect, etc.), but it could be useful elsewhere too.

Thank you.

robertknight commented 6 months ago

For the geometry types in rten-imageproc I can see this would be useful, and those types should have a pretty stable representation. For types in other crates I think I'd wait until a concrete use case came up.

Being able to (de-)serialize tensors is another obviously useful thing, but there are more decisions to think through. In the interim you can convert a tensor to an ndarray array and (de-)serialize that.

robertknight commented 6 months ago

Fixed by https://github.com/robertknight/rten/pull/198.