MCPcopy
hub / github.com/dmlc/dgl / create_shared_mem_array

Function create_shared_mem_array

python/dgl/ndarray.py:170–191  ·  view source on GitHub ↗

Create a tensor from shared memory with the 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 -------

(name, shape, dtype)

Source from the content-addressed store, hash-verified

168
169
170def create_shared_mem_array(name, shape, dtype):
171 """Create a tensor from shared memory with the specific name
172
173 Parameters
174 ----------
175 name : str
176 The unique name of the shared memory
177 shape : tuple of int
178 The shape of the returned tensor
179 dtype : F.dtype
180 The dtype of the returned tensor
181
182 Returns
183 -------
184 F.tensor
185 The created tensor.
186 """
187 new_arr = empty_shared_mem(
188 name, True, shape, F.reverse_data_type_dict[dtype]
189 )
190 dlpack = new_arr.to_dlpack()
191 return F.zerocopy_from_dlpack(dlpack)
192
193
194def exist_shared_mem_array(name):

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