How to make a type_caster for std::mdspan to convert from/to ML framework-agnostic ndarray #328
Unanswered
Char-Aznable
asked this question in
Q&A
Replies: 1 comment 3 replies
-
It boils down to the question of: what kind of Python object would you like to have? If you remove the numpy annotation, you'll get a DLPack capsule which is not exactly user-friendly. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have implemented a custom type_caster for std::mdspan (using rapids/raft's implementation). I wrote this type_caster basing on nanobind's Eigen::Map's type_caster. However, one limitation is that the corresponding ndarray annotation type is hardcoded to the numpy framework. I want to make this std::mdspan type_caster framework agnostic. Can I simply remove the
numpy
annotation from this line? What alternative approaches can I use?Beta Was this translation helpful? Give feedback.
All reactions