Model accuracy calculator

My code snippet shows how these two tensors can be compared and you could calculate the mean afterwards. For the single sample you would get an accuracy of 100%, since it contains the right prediction.
If you want to calculate the accuracy for the entire validation dataset, you could sum the correctly classified samples and divide by the number of samples afterwards (outside of the validation loop).