pykeio / ort

Fast ML inference & training for Rust with ONNX Runtime
https://ort.pyke.io/
Apache License 2.0
786 stars 91 forks source link

Incorrect lifetimes for `impl IntoValueTensor for &CowArray` #270

Closed barakugav closed 2 weeks ago

barakugav commented 3 weeks ago

The current implementation of impl IntoValueTensor for &CowArray is:

impl<'i, 'v, T: Clone + 'static, D: Dimension + 'static> IntoValueTensor for &'i CowArray<'v, T, D>
where
    'i: 'v
{
...
}

Note the 'i: 'v where 'v is the lifetime of the data of the array, and 'i is the lifetime of the array itself. This constraint is impossible to satisfy, the lifetime of the array is always shorter than the lifetime of the data of the array.

Thanks for the support! Love the library

barakugav commented 2 weeks ago

Thanks ❤️ ! If the function doesnt really care about 'i: 'v vs 'v: 'i, I think the Rusty thing to do is just to remove the bound entirely. Anyway, this solves my problem