You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove the `Tensor::new_from_host_ptr` function since it passed along a pointer across the FFI boundary to OpenVINO that relied on the lifetime of the buffer, a `&[u8]`, which only was required to live as long as the function call. When that buffer went out of scope the pointer was invalid, causing some observed segfaults with later usage of that tensor. The offending function in this case was `Core::read_model_from_buffer`, which ended up holding on to the weights tensor until some later time.
This will force all tensor creation to occur via copying (e.g., `slice::copy_from_slice`). Eventually we should work out a scheme to avoid this extra work; using `PhantomData` to propagate lifetimes started touching too much code but there is likely something else that can be done here instead.
0 commit comments