-
|
Hello NuMojo maintainers, First of all, thank you for all your work on NuMojo!!! I usually use Polars, NumPy, and Numba to write my "fast" Python code. My goal is to integrate Mojo into my workflows. Is there an existing helper in NuMojo for creating a zero-copy NDArrayView from a NumPy ndarray? I noticed that Modular has introduced a high-performance “LayoutTensor” type in Mojo. Will NuMojo eventually be build on top of the native Mojo tensor APIs? I've tried to implement a "numpy_to_ndarray_view()" function which seems to work as it should. I would be very happy to get some feedback if it's OK like this: Kind regards |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hi @Olobir! It is a very good question! From months ago, we were trying to prepare for this array view to avoid excessive copying during array manipulation and conversion. For example, this discussion and the PR 175 are some early changes in design to allow shared memory. The branch "arrayview" contains a pilot However, the only thing that blocked us from proceeding further is the lack of support of parameterized trait in Mojo. Without this functionality, we cannot build a generic Another feature that we are waiting for is the reference system. Note that the
Probably not, I think. We built the |
Beta Was this translation helpful? Give feedback.
-
|
Thank you very much for the explanation, @forfudan . |
Beta Was this translation helpful? Give feedback.
Hi @Olobir! It is a very good question! From months ago, we were trying to prepare for this array view to avoid excessive copying during array manipulation and conversion. For example, this discussion and the PR 175 are some early changes in design to allow shared memory. The branch "arrayview" contains a pilot
ArrayViewon the matrix type.However, the only thing that blocked us from proceeding further is the lack of support of parameterized trait in Mojo. Without this functionality, we cannot build a generic
ArrayViewtype. So we have to wait for some months (or years? Hope not).Another feature that we are waiting for is the reference system. Note that the
refkeyword is only available…