You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

pyarray.cc 286 B

123456789101112
  1. #include "pyarray.h"
  2. namespace pyarr {
  3. std::vector<float> ndarray_to_vector(py::array_t<float> array) {
  4. py::buffer_info info = array.request();
  5. float* dataPtr = static_cast<float*>(info.ptr);
  6. std::vector<float> result(dataPtr, dataPtr + info.size);
  7. return result;
  8. }
  9. }