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
Currently, you can pass a typed array to Python, getting a buffer which you can then use with np.frombuffer to get a Numpy array (and make sure you match the datatype on both sides). When passing a Numpy array to Javascript, you get regular (non-typed) Javascript arrays, which is a less-than-optimal use of memory. This requires getting the datatype correct and knowing how to do this.
It would be nice to have a more convenient way to do this. It can't be built-in, since the user may not be using Numpy, but maybe if there's an explicit way to turn this on, the conversion code could then implicitly do this.
The text was updated successfully, but these errors were encountered:
Currently, you can pass a typed array to Python, getting a buffer which you can then use with
np.frombuffer
to get a Numpy array (and make sure you match the datatype on both sides). When passing a Numpy array to Javascript, you get regular (non-typed) Javascript arrays, which is a less-than-optimal use of memory. This requires getting the datatype correct and knowing how to do this.It would be nice to have a more convenient way to do this. It can't be built-in, since the user may not be using Numpy, but maybe if there's an explicit way to turn this on, the conversion code could then implicitly do this.
The text was updated successfully, but these errors were encountered: