code: def async_write(src, dst, offset, count):
      """This api provides a way to write pieces of source tensor to destination tensor
      asynchronously. In which, we use `offset` and `count` to determine copy to where.
      `offset` means the begin points of the copy destination of `dst`, and `count`
      means the lengths of the copy destination of `dst`. To be noted, the copy process
      will run asynchronously from cuda to pin memory.
  
      We can simply remember this as "gpu async_write to pin_memory". We should run this
      api under GPU version PaddlePaddle.
  
      Args:
  
          src (Tensor): The source tensor, and the data type should be `float32` currently.
                        Besides, `src` should be placed on CUDAPlace.
  
          dst (Tensor): The destination tensor, and the data type should be `float32` currently.
                        Besides, `dst` should be placed on CUDAPinnedPlace. The shape of
                        `dst` should be the same with `src` except for the first dimension.
  
          offset (Tensor): The offset tensor, and the data type should be `int64` currently.
                        Besides, `offset` should be placed on CPUPlace. The shape of `offset`
                        should be one-dimensional.
  
          count (Tensor): The count tensor, and the data type should be `int64` currently.
                        Besides, `count` should be placed on CPUPlace. The shape of `count`
                        should be one-dimensinal.
  
      Examples:
  
          import numpy as np
          import paddle
          from pgl.utils.stream_pool import async_write
  
          src = paddle.rand(shape=[100, 50, 50])
          dst = paddle.empty(shape=[200, 50, 50]).pin_memory()
          offset = paddle.to_tensor(
               np.array([0, 60], dtype="int64"), place=paddle.CPUPlace())
          count = paddle.to_tensor(
               np.array([40, 60], dtype="int64"), place=paddle.CPUPlace())
          async_write(src, dst, offset, count)
  
      """
  
      core.async_write(src, dst, offset, count)
  
imports: import numpy
  import paddle
  from paddle.framework import core
  from paddle.device import cuda
  from pgl.utils.logger import log
label_desc: Use image node_id 2 for calling a global function with example usage: async_write(src, dst, offset, count) without return types