class_docstr: A simple Device/CPU Array object in runtime.
docstr: Perform a synchronized copy from the array.
  
  Parameters
  ----------
  source_array : array_like
      The data source we should like to copy from.
  
  Returns
  -------
  arr : NDArray
      Reference to self.
docstr_tok: ["Perform","a","synchronized","copy","from","the","array",".","Parameters","--","--","--","--","--","source_array",":","array_like","The","data","source","we","should","like","to","copy","from",".","Returns","--","--","--","-","arr",":","NDArray","Reference","to","self","."]
code: def copyfrom(self, source_array):
      """Perform a synchronized copy from the array.
  
      Parameters
      ----------
      source_array : array_like
          The data source we should like to copy from.
  
      Returns
      -------
      arr : NDArray
          Reference to self.
      """
      if isinstance(source_array, NDArrayBase):
          source_array.copyto(self)
          return self
  
      if not isinstance(source_array, np.ndarray):
          try:
              source_array = np.asarray(source_array, dtype=self.dtype)
          except:
              raise TypeError(
                  "array must be an array_like data,"
                  + "type %s is not supported" % str(type(source_array))
              )
      t = DGLDataType(self.dtype)
      shape, dtype = self.shape, self.dtype
      if t.lanes > 1:
          shape = shape + (t.lanes,)
          t.lanes = 1
          dtype = str(t)
  
      if source_array.shape != shape:
          raise ValueError(
              "array shape do not match the shape of NDArray {0} vs {1}".format(
                  source_array.shape, shape
              )
          )
      source_array = np.ascontiguousarray(source_array, dtype=dtype)
      assert source_array.flags["C_CONTIGUOUS"]
      data = source_array.ctypes.data_as(ctypes.c_void_p)
      nbytes = ctypes.c_size_t(
          source_array.size * source_array.dtype.itemsize
      )
      check_call(_LIB.DGLArrayCopyFromBytes(self.handle, data, nbytes))
      return self
  
imports: from __future__ import absolute_import
  import ctypes
  import sys
  import numpy
  from .base import _FFI_MODE, _LIB, c_array, c_str, check_call, string_types
  from .runtime_ctypes import dgl_shape_index_t, DGLArray, DGLArrayHandle, DGLContext, DGLDataType, TypeCode
label_desc: Use image node_id 10 for calling the NDArrayBase obj's underlying member method code with example usage: obj.copyfrom(source_array) and returns: self, self