refactor: module -> module_ with typedef (#2544)
* WIP: module -> module_ without typedef * refactor: allow py::module to work again
This commit is contained in:
@@ -317,11 +317,11 @@ TEST_SUBMODULE(eigen, m) {
|
||||
// a new array (np.ones(10)) increases the chances that the temp array will be garbage
|
||||
// collected and/or that its memory will be overridden with different values.
|
||||
m.def("get_elem_direct", [](Eigen::Ref<const Eigen::VectorXd> v) {
|
||||
py::module::import("numpy").attr("ones")(10);
|
||||
py::module_::import("numpy").attr("ones")(10);
|
||||
return v(5);
|
||||
});
|
||||
m.def("get_elem_indirect", [](std::vector<Eigen::Ref<const Eigen::VectorXd>> v) {
|
||||
py::module::import("numpy").attr("ones")(10);
|
||||
py::module_::import("numpy").attr("ones")(10);
|
||||
return v[0](5);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user