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
Does pybind11 lack support for converting numpy arrays to std::vector (of floats) ?
I have tried converting to list (success) and then to vector (fails), and so many things. I tried this direct conversion and it also fails with the error below:
auto vec = py::cast<std::vector<float>>(args[0]);
error:
Unable to cast Python instance of type <class 'numpy.ndarray'> to C++ type 'std::vector<float, std::allocator<float> >
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Does
pybind11
lack support for converting numpy arrays to std::vector (of floats) ?I have tried converting to list (success) and then to vector (fails), and so many things. I tried this
direct conversion
and it also fails with the error below:error:
args is a tuple list of:
and looks something like this:
Beta Was this translation helpful? Give feedback.
All reactions