code: def move_to(obj, device):
      """Function to move objects of different types
      containing a tensor to device.
      """
      if torch.is_tensor(obj):
          return obj.to(device)
      elif isinstance(obj, dict):
          res = {}
          for k, v in obj.items():
              res[k] = move_to(v, device)
          return res
      elif isinstance(obj, list):
          res = []
          for v in obj:
              res.append(move_to(v, device))
          return res
      else:
          raise TypeError("Invalid type for move_to")
  
label_desc: Use image node_id 1 for calling a global function with example usage: move_to(obj, device) and returns: obj, res, res