code: def place_on_gpu(data):
      
      data_type = type(data)
      if data_type in (list, tuple):
          data = [place_on_gpu(data[i]) for i in range(len(data))]
          data = data_type(data)
          return data
      elif isinstance(data, torch.Tensor):
          return data.cuda()
      else:
          return ValueError(f"Data type {type(data)} not recognized.")
docs: Utility to place data on GPU, where data could be a torch.Tensor, a tuple
      or list of Tensors, or a tuple or list of tuple or lists of Tensors