MCPcopy Index your code
hub / github.com/dmlc/dgl / get_shared_mem_array

Function get_shared_mem_array

python/dgl/ndarray.py:146–167  ·  view source on GitHub ↗

Get a tensor from shared memory with specific name Parameters ---------- name : str The unique name of the shared memory shape : tuple of int The shape of the returned tensor dtype : F.dtype The dtype of the returned tensor Returns ------- F.

(name, shape, dtype)

Source from the content-addressed store, hash-verified

144
145
146def get_shared_mem_array(name, shape, dtype):
147 """Get a tensor from shared memory with specific name
148
149 Parameters
150 ----------
151 name : str
152 The unique name of the shared memory
153 shape : tuple of int
154 The shape of the returned tensor
155 dtype : F.dtype
156 The dtype of the returned tensor
157
158 Returns
159 -------
160 F.tensor
161 The tensor got from shared memory.
162 """
163 new_arr = empty_shared_mem(
164 name, False, shape, F.reverse_data_type_dict[dtype]
165 )
166 dlpack = new_arr.to_dlpack()
167 return F.zerocopy_from_dlpack(dlpack)
168
169
170def create_shared_mem_array(name, shape, dtype):

Callers 7

_shared_setupMethod · 0.85
_shared_stepMethod · 0.85
setupMethod · 0.85
setupMethod · 0.85
__init__Method · 0.85
_all_get_tensorMethod · 0.85
call_once_and_shareFunction · 0.85

Calls 2

empty_shared_memFunction · 0.85
to_dlpackMethod · 0.80

Tested by

no test coverage detected