The following code
batch_size = 4 plt.figure() for i_batch, sample_batched in enumerate(loader): plt.title(f"i_batch = {i_batch}")