code: def copy_tensor(dst_tensor, src_tensor):
      """Copy the content from src_tensor to dst_tensor.
  
      Args:
          dst_tensor: the tensor to copy from.
          src_tensor: the tensor to copy to.
  
      Returns:
          None
      """
      copied = True
      if isinstance(dst_tensor, cupy.ndarray) and isinstance(
          src_tensor, cupy.ndarray
      ):
          cupy.copyto(dst_tensor, src_tensor)
      elif torch_available():
          if isinstance(dst_tensor, torch.Tensor) and isinstance(
              src_tensor, torch.Tensor
          ):
              dst_tensor.copy_(src_tensor)
          elif isinstance(dst_tensor, torch.Tensor) and isinstance(
              src_tensor, cupy.ndarray
          ):
              t = torch.utils.dlpack.from_dlpack(src_tensor.toDlpack())
              dst_tensor.copy_(t)
          elif isinstance(dst_tensor, cupy.ndarray) and isinstance(
              src_tensor, torch.Tensor
          ):
              t = cupy.fromDlpack(
                  torch.utils.dlpack.to_dlpack(src_tensor)
              )
              cupy.copyto(dst_tensor, t)
          else:
              copied = False
      else:
          copied = False
      if not copied:
          raise ValueError(
              "Unsupported tensor type. Got: {} and {}. Supported "
              "GPU tensor types are: torch.Tensor, cupy.ndarray.".format(
                  type(dst_tensor), type(src_tensor)
              )
          )
  
file_path: ray/python/ray/util/collective/collective_group/nccl_util.py
imports: import numpy
  from ray.util.collective.types import ReduceOp, torch_available
label_desc: Use image node_id 14 for calling a global function with example usage: copy_tensor(dst_tensor, src_tensor) without return types