This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <pybind11/embed.h> // everything needed for embedding | |
#include <pybind11/numpy.h> | |
namespace py = pybind11; | |
py::array_t<double> create2DArray(int rows, int cols) { | |
py::array_t<double> result({rows, cols}); | |
auto ptr = result.mutable_data(); | |
/* | |
ptr[0] | ptr[1] | ptr[2] |