I have written a c++ lib and the function signature is, let's say xt::xarray<double> func(xt::xarray<double>& m). And now I need to write a python wrapper for this lib. So I try to write something like this:
PYBIND_MODULE(cpp_kernel, m) {
xt::import_numpy();
m.def("func", [](xt::pyarray<double>& m){ /* convert xt::pyarray to xt::array*/ } , "python wrapper")
}
It seems that both implicit conversion and xt::adapt fails. How can I implement this ?
Thanks in advance!
I have written a c++ lib and the function signature is, let's say
xt::xarray<double> func(xt::xarray<double>& m)
. And now I need to write a python wrapper for this lib. So I try to write something like this:It seems that both implicit conversion and
xt::adapt
fails. How can I implement this ? Thanks in advance!