jeudi 24 mars 2022

Pybind11 : available array_t constructors

I want to create an array_t from a double* and size.

I did not find a constructor mentioned explicitely in the docs.

I tried to copy this thread : PyBind11 : returning c++ array as numpy array changes values

But when I try, I get an error : fatal error: no matching constructor for initialization of 'py::array_t' py::array_t test = py::array_t({size, DIM},{DIM*8, 8}, data);

where size and dim are unsigned int and data is a double*.

How can I construct an array_t, and, more importantly, where is this information available ?

Aucun commentaire:

Enregistrer un commentaire