This is the code:

if __name__=='main':
    
    def show_landmarks_batch(sample_batched):
        """Show image with landmarks for a batch of samples."""
        images_batch, landmarks_batch = \
                sample_batched['image'], sample_batched['landmarks']
        batch_size = len(images_batch)
        im_size = images_batch.size(2)
    
        grid = utils.make_grid(images_batch)
        plt.imshow(grid.numpy().transpose((1, 2, 0)))
    
        for i in range(batch_size):
            plt.scatter(landmarks_batch[i, :, 0].numpy() + i * im_size,
                        landmarks_batch[i, :, 1].numpy(),
                        s=10, marker='.', c='r')
    
            plt.title('Batch from dataloader')
    
    
    for i_batch, sample_batched in enumerate(dataloader):
      print(i_batch, sample_batched['image'].size(),
          sample_batched['landmarks'].size())
    
    # observe 4th batch and stop
      if i_batch == 3:
        plt.figure()
        show_landmarks_batch(sample_batched)
        plt.axis('off')
        plt.ioff()
        plt.show()
        break

Basically it shows a batch of 4 images using matplotlib with the help of the function  show_landmarks_batch.
Its a part of the code in Pytorch tutorials in the Pytorch website.