def peek(self):
    """Peek at the next training batch or test example without dequeuing it.

    Returns:
      batch: dict, has 'pixels' and 'rays'.
    """
    x = self.queue.queue[0].copy()  # Make a copy of the front of the queue.
    if self.split == 'train':
      return utils.shard(x)
    else:
      return utils.to_device(x)
Peek at the next training batch or test example without dequeuing it.

    Returns:
      batch: dict, has 'pixels' and 'rays'.
    
internal/datasets.py