What version (or hash if on master) of pybind11 are you using?
aa304c9c7d725ffb9d10af08a3b34cb372307020
Problem description
Converting a py::handle to py::array leads to segmentation fault.
Reproducible example code
// C++ code
void test(py::list list) {
for (auto&& obj : list) {
auto handle = obj.cast<py::handle>();
std::cout << handle.get_type().attr("__name__").cast<std::string>() << std::endl; // Show 'ndarray'
auto arr = pybind11::array::ensure(handle); // Crash here
// auto arr = py::cast<py::array>(handle); // Also crash
// Other code below based on the dtype and shape of the array
}
}
// Python code
arr = np.random.randn(4,4)
test([arr])
Is this a regression? Put the last known working version here if it is.
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
aa304c9c7d725ffb9d10af08a3b34cb372307020
Problem description
Converting a py::handle to py::array leads to segmentation fault.
Reproducible example code
Is this a regression? Put the last known working version here if it is.
Not a regression