mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
added numpy test (minor): check that 'strides' is respected even when creating new arrays
- This actually works with no changes, I just wasn't 100% convinced and decided to write a test to see if it's true.
This commit is contained in:
@@ -91,4 +91,12 @@ test_initializer numpy_array([](py::module &m) {
|
||||
def_index_fn(mutate_data_t, arr_t&);
|
||||
def_index_fn(at_t, const arr_t&);
|
||||
def_index_fn(mutate_at_t, arr_t&);
|
||||
|
||||
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 });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user