Created
June 5, 2018 18:05
-
-
Save zhreshold/d564d6149dcfbeced61116a9f5fce8d9 to your computer and use it in GitHub Desktop.
NDArray shared mem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mxnet as mx | |
from mxnet import nd | |
data = mx.nd.array([1,2,3], ctx=mx.Context('cpu_shared', 0)) | |
pid, fd, shape, dtype = data._to_shared_mem() | |
new_data = mx.nd.NDArray(nd.ndarray._new_from_shared_mem(pid, fd, shape, dtype)) | |
print(new_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment