code: def get_device_of(tensor: torch.Tensor) -> int:
      """
      Returns the device of the tensor.
      """
      if not tensor.is_cuda:
          return -1
      else:
          return tensor.get_device()
  
file_path: jiant/jiant/ext/allennlp.py
imports: from typing import Optional
  import torch
  import torch.nn
label_desc: Use image node_id 6 for calling a global function with example usage: get_device_of(tensor) and returns: unknown, tensor