Replies: 1 comment
-
I solved this issue by create a custom caster for armadillo mat and use the move rv policy. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Hi,
I'm working on a Python package based on nanobind and a 3rd-party C++ library
libgwmodel
. Everything else works fine but when I try to convert a vector of armadillo to ndarray, the first two elements both become 0. However, when a matrix is converted to ndarray, everything works normally. I tried to convert the armadillo vector to ndarry of shape (n, 1), the first two elements are still 0.The following is a part of my code
A vector should be
But after the conversion from armadillo vector to ndarray, it becomes
And when I read for multiple times, the returned matrices are not the same.
I tried to remove the
wrap(vec&)
to convert vectors like matrices (viawrap(mat&)
asvec
is a subclass ofmat
), but it won't help.Could anyone give me some clues? I appreciate it very much.
Beta Was this translation helpful? Give feedback.
All reactions