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

Method copyto

python/dgl/_ffi/ndarray.py:346–360  ·  view source on GitHub ↗

Copy array to target Parameters ---------- target : NDArray The target array to be copied, must have same shape as this array.

(self, target)

Source from the content-addressed store, hash-verified

344 return np_arr
345
346 def copyto(self, target):
347 """Copy array to target
348
349 Parameters
350 ----------
351 target : NDArray
352 The target array to be copied, must have same shape as this array.
353 """
354 if isinstance(target, DGLContext):
355 target = empty(self.shape, self.dtype, target)
356 if isinstance(target, NDArrayBase):
357 check_call(_LIB.DGLArrayCopyFromTo(self.handle, target.handle))
358 else:
359 raise ValueError("Unsupported target type %s" % str(type(target)))
360 return target
361
362 def pin_memory_(self):
363 """Pin host memory and map into GPU address space (in-place)"""

Callers 4

_to_shared_memFunction · 0.80
__setitem__Method · 0.80
copyfromMethod · 0.80
perform_copyFunction · 0.80

Calls 2

check_callFunction · 0.85
emptyFunction · 0.70

Tested by 1

perform_copyFunction · 0.64