kornia / kornia-rs

Low-level Computer Vision library in Rust
https://docs.rs/kornia
Apache License 2.0
171 stars 16 forks source link

Verify that pyo3 transfer the ownership of the data to python #17

Closed edgarriba closed 6 months ago

edgarriba commented 2 years ago

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 :)

carlosb1 commented 1 year ago

I think, the first step could be get more information about why pycapsules is not a good practice...