-
Hello! I am trying to return an array allocated on stack and was following the guide https://nanobind.readthedocs.io/en/latest/ndarray.html#returning-temporaries. I am encountering the following error, where it states what is is returned does not match the function signature.
Could someone tell me what to do in that case? It works without the
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
ndarray::cast()
returns an instance ofnb::detail::ndarray_object<Args...>
, notnb::ndarray<Args...>
. They are not interconvertible;ndarray_object
wraps a Python object whilendarray
doesn't necessarily. It is probably ideal to write your function with anauto
return type in order to avoid needing to name this internal type.