RuntimeError                              Traceback (most recent call last)
<ipython-input-214-52ea346a67f2> in <module>
      7         _, predicted_auto = torch.max(outputs_auto.data, 1)
      8         total += labels.size(0)
----> 9         correct += (predicted_auto == labels).sum().item()
     10 
     11 print('Accuracy of the network on the 10000 test images: %d %%' % (

RuntimeError: The size of tensor a (32) must match the size of tensor b (16) at non-singleton dimension 2

This is the full code that computes the accuracy of the model
correct = 0
total = 0
with torch.no_grad():
    for data in testloader:
        images, labels = data[0].to(device), data[1].to(device)
        outputs_auto = autoencoder(images.to(device))
        _, predicted_auto = torch.max(outputs_auto.data, 1)
        total += labels.size(0)
        correct += (predicted_auto == labels).sum().item()

print('Accuracy of the network on the 10000 test images: %d %%' % (
    100 * correct / total))