code: def get_tensor_device(tensor):
      if isinstance(tensor, numpy.ndarray):
          return "cpu"
      elif torch_available() and isinstance(tensor, torch.Tensor):
          if not tensor.is_cuda:
              return "cpu"
          else:
              return "cuda"
      else:
          raise RuntimeError(
              "Unrecognized tensor type: '{}'.".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 8 for calling a global function with example usage: get_tensor_device(tensor) and returns: str, str, str