try printing out the output of the model and the target, i think the model is outputing probabilities of each of the possible number [1-10] , you’ll have to do i convert the target to one hot and then apply a loss function,
also take a look here (uses the MNIST dataset from pytorch) https://github.com/AvivSham/Pytorch-MNIST-colab/blob/master/Pytorch_MNIST.ipynb 98