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 am trying to share a np.memmap array across two processes by sharing the underlying mmap-ed file. To fully replicate this across processes, I need to replicate the filename (to share the buffer) and the numpy metadata. Unfortunately, the np.memmap constructor does not take a strides argument, which means that I can't directly construct the appropriate array.
but I think it'd be nice for np.memmap to directly supported the strides argument.
Implementationally, I think we just need to update the num_bytes calculation to take into acount striding and to pass strides into the ndarray.__new__ call at
I am trying to share a
np.memmap
array across two processes by sharing the underlyingmmap
-ed file. To fully replicate this across processes, I need to replicate the filename (to share the buffer) and the numpy metadata. Unfortunately, thenp.memmap
constructor does not take astrides
argument, which means that I can't directly construct the appropriate array.I can currently achieve my aim by doing:
but I think it'd be nice for
np.memmap
to directly supported thestrides
argument.Implementationally, I think we just need to update the
num_bytes
calculation to take into acount striding and to passstrides
into thendarray.__new__
call atnumpy/numpy/core/memmap.py
Lines 269 to 270 in a14c412
The text was updated successfully, but these errors were encountered: