code: def feed_ndarray(dali_tensor, ptr, cuda_stream=None):
      """
      Copy contents of DALI tensor to Paddle's Tensor.
  
      Parameters
      ----------
      `dali_tensor` : dali.backend.TensorCPU or dali.backend.TensorGPU
                      Tensor from which to copy
      `ptr` : LoDTensor data pointer
              Destination of the copy
      `cuda_stream` : cudaStream_t handle or any value that can be cast to cudaStream_t
                      CUDA stream to be used for the copy
                      (if not provided, an internal user stream will be selected)
      """
  
      cuda_stream = types._raw_cuda_stream(cuda_stream)
  
      c_type_pointer = ctypes.c_void_p(ptr)
      if isinstance(dali_tensor, (TensorGPU, TensorListGPU)):
          stream = (
              None
              if cuda_stream is None
              else ctypes.c_void_p(cuda_stream)
          )
          dali_tensor.copy_to_external(
              c_type_pointer, stream, non_blocking=True
          )
      else:
          dali_tensor.copy_to_external(c_type_pointer)
      return ptr
  
file_path: DALI/dali/python/nvidia/dali/plugin/paddle.py
imports: import ctypes
  import math
  import numpy
  import paddle
  from distutils.version import LooseVersion
  from nvidia.dali import types
  from nvidia.dali.backend import TensorListCPU, TensorGPU, TensorListGPU
  from nvidia.dali.plugin.base_iterator import _DaliBaseIterator
  from nvidia.dali.plugin.base_iterator import LastBatchPolicy
label_desc: Use image node_id 2 for calling a global function with example usage: feed_ndarray(dali_tensor, ptr, cuda_stream) and returns: ptr