Verify that pyo3 transfer the ownership of the data to python
edgarriba opened this issue · comments
Edgar Riba commented
we want move semantics to happen and avoid copies around the tensor data. @strasdat any thoughts here ?
Context about how we do it now: https://github.com/kornia/kornia-rs/blob/main/src/dlpack_py.rs#L27-L62
It's done via python capsules to match compatibility with dl frameworks implementing dlpack.
See also: https://github.com/kornia/dlpack-rs
However, for some reason i was suggested by some one from the pyo3 community to avoid pycapsules :)
Carlos B commented
I think, the first step could be get more information about why pycapsules is not a good practice...