from matplotlib import pyplot import numpy as np pyplot.imshow([x_train](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor "torch.Tensor")[0].reshape((28, 28)), cmap="gray") # ``pyplot.show()`` only if not on Colab try: import google.colab except ImportError: pyplot.show() print([x_train.shape](https://docs.pytorch.org/docs/stable/size.html#torch.Size "torch.Size"))