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

Class NDArray

python/dgl/ndarray.py:31–51  ·  view source on GitHub ↗

Lightweight NDArray class for DGL framework.

Source from the content-addressed store, hash-verified

29
30
31class NDArray(NDArrayBase):
32 """Lightweight NDArray class for DGL framework."""
33
34 def __len__(self):
35 return functools.reduce(operator.mul, self.shape, 1)
36
37 def shared_memory(self, name):
38 """Return a copy of the ndarray in shared memory
39
40 Parameters
41 ----------
42 name : str
43 The name of the shared memory
44
45 Returns
46 -------
47 NDArray
48 """
49 return empty_shared_mem(name, True, self.shape, self.dtype).copyfrom(
50 self
51 )
52
53
54def cpu(dev_id=0):

Callers 1

zerocopy_from_numpyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected