How to expose raw memory without numpy #5861
Unanswered
yobeonline
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a situation similar to what is described in #2271. In short, I expose a C++ object that has a
std:vector<std::vector<T>> columns
attribute. A member function taking an index returns the selected nested vector as a numpy array:Out of curiosity, I am trying to do it without the numpy dependency. I believe it means my
get_array
function should now return apy::memoryview
instance:My problem is that I can't find how to pass the
py::cast(*this)
reference to tie the lifetime ofthis
and the memoryview object. I have reached the point where I doubt memoryviews were design to do what I am trying to do and am wondering what I should use instead or if it is even possible to not use numpy arrays.Beta Was this translation helpful? Give feedback.
All reactions