code: def get_numpy_tensor_dtype(tensor):
      """Return the corresponded Cupy dtype given a tensor."""
      if isinstance(tensor, numpy.ndarray):
          return tensor.dtype.type
      if torch_available():
          if isinstance(tensor, torch.Tensor):
              return TORCH_NUMPY_DTYPE_MAP[tensor.dtype]
      raise ValueError(
          "Unsupported tensor type. Got: {}. Supported "
          "CPU tensor types are: torch.Tensor, "
          "numpy.ndarray.".format(type(tensor))
      )
  
imports: import asyncio
  import time
  from typing import List
  import numpy
  import ray
  import ray.experimental.internal_kv
  from ray._raylet import GcsClient
  from ray.util.collective.types import ReduceOp, torch_available
  from ray.util.queue import _QueueActor
label_desc: Use image node_id 4 for calling a global function with example usage: get_numpy_tensor_dtype(tensor) and returns: tensor, TORCH_NUMPY_DTYPE_MAP