Eigen::Map readwrite access from Python - difference between pybind11 and nanobind #380
ThoreWietzke
started this conversation in
General
Replies: 1 comment 5 replies
-
One additional information: in pybind there exist an issue with a similar question: pybind/pybind11#1402, but an explanaition for this behaviour ist not mentioned. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have a C++ Struct which contains Eigen::Maps which point to allocated memory from a C interface.
The layout is as follows:
The binding code for my struct is as follows:
In pybind11 such binding code results in an error, because the
load
method in their type caster gets explicitly deleted because of the read/write access of the map. In nanobind this works fine, because the correspondingfrom_python
method exits for this binding.My question is, are there any issues in allowing this conversion?
Compilation works fine and setting the elements of the exposed map in Python also works fine.
Beta Was this translation helpful? Give feedback.
All reactions