You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to pre-allocate a py::array_t<float> for the worst-case size,
then call a C++ function that writes some elements and returns the number of elements actually written,
and, finally, resize py::array_t<float> to match the number of elements actually written:
This seems to work, but I'm not sure whether it happens to work just by coincidence.
Does the above code uses py::array_t<float> correctly?
In particular, is it correct to call out.resize() after out.request()?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I need to pre-allocate a
py::array_t<float>
for the worst-case size,then call a C++ function that writes some elements and returns the number of elements actually written,
and, finally, resize
py::array_t<float>
to match the number of elements actually written:This seems to work, but I'm not sure whether it happens to work just by coincidence.
Does the above code uses
py::array_t<float>
correctly?In particular, is it correct to call
out.resize()
afterout.request()
?Beta Was this translation helpful? Give feedback.
All reactions