Essentially, the first dimension should be the batch size, if you are using Dataloader. For image dataset like MNIST, it is of the form [N X C X H X W]
N = batch size
C = channel (R,G,B)
H, W = height and width
If you are not using Dataloader and manually iterating over dataset, you don’t need it.