code: def from_device(self, src, size, offset=0, stream=None):
      dst = self.memory + offset
      xp = chainer.backend.get_array_module(src)
      if xp == cp:
          src_data = src.data
      elif xp == chx:
          src_data = _get_memory_pointer_from_chainerx(src)
      else:
          raise ValueError(
              "{} is from an unsupported array module".format(type(src))
          )
      if stream is None:
          dst.copy_from_device(src_data, size)
      else:
          dst.copy_from_device_async(src_data, size, stream)
  
imports: import ctypes
  import mpi4py.MPI
  import numpy
  from chainermn.communicators import _communication_utility
  import chainer.backends
  import chainerx
label_desc: Use image node_id 3 for calling the DeviceMemory obj's underlying member method code with example usage: obj.from_device(src, size, offset, stream) without return types