I’m planning to have a plain C library that would return struct DLManagedTensor instances. I interface with it in Python with ctypes.
How would it be possible to use from_dlpack(...) on such ctypes DLManagedTensor objects? How do I construct a “PyCapsule” from such a ctypes object? Should I use ctypes.pythonapi.PyCapsule_New 2? Would there be any memory leaks of the capsule object themselves?
Thanks!