wll-interface icon indicating copy to clipboard operation
wll-interface copied to clipboard

question about returning by reference + `PackedArray`

Open samuelpmish opened this issue 9 months ago • 4 comments

Thank you for developing wll-interface, it's been incredibly useful in my personal projects. My question is:

Is there a way to return a wll::tensor by-reference if the dimensions are not known a priori?

Right now, I'm splitting up any C++ routines that have multiple returns into:

  • one function that calculates the outputs and writes them to some global variable
  • "getters" that access that global and return each output individually

Returning multiple things by-reference would be cleaner and thread-safe, but when I tried it, my C++ functions that resized the by-reference output wll::tensors caused the kernel to crash.

samuelpmish avatar Sep 25 '23 21:09 samuelpmish