It seems you are trying to pass the MNIST data as images, while your model is a fully-connected neural network.
You could flatten the data in your training loop using this code:
data = data.view(data.size(0), -1)
output = model(data)

PS: You can add code using three backticks `