mirror of
https://github.com/pybind/pybind11.git
synced 2026-06-30 03:17:02 +00:00
Fix SEGV to create empty shaped numpy array (#1371)
Fix a segfault when creating a 0-dimension, c-strides array.
This commit is contained in:
committed by
Wenzel Jakob
parent
abf916d845
commit
a50125ff85
@@ -102,6 +102,9 @@ TEST_SUBMODULE(numpy_array, sm) {
|
||||
sm.def("make_f_array", [] { return py::array_t<float>({ 2, 2 }, { 4, 8 }); });
|
||||
sm.def("make_c_array", [] { return py::array_t<float>({ 2, 2 }, { 8, 4 }); });
|
||||
|
||||
// test_empty_shaped_array
|
||||
sm.def("make_empty_shaped_array", [] { return py::array(py::dtype("f"), {}, {}); });
|
||||
|
||||
// test_wrap
|
||||
sm.def("wrap", [](py::array a) {
|
||||
return py::array(
|
||||
|
||||
Reference in New Issue
Block a user