I can’t figure out how to use built-in python functions from mojo. Specifically, i want to wrap a numpy array around a mojo HostDevice, and i need the python memoryview() function for that. How to call it?
Python.memoryview() doesn’t work…
I tried an alternative way of wrapping using ctypes and numpy.ndarray() but it crashes. No built-in python functions were needed there.
If anyone had managed to wrap a mojo (unsafe) pointer to memory into a numpy array, please share your code.