I think I am missing something in the saving and loading files by torch. I saved prediction, labels, and later I called torch.load to retrieve these values,
prediction_load = torch.load(ME_DIR + 'prediction' + '.torch')         
labels_load = torch.load(ME_DIR + 'labels' + '.torch')

for i in range(len(prediction_load)):
    _, predicted = torch.max(prediction_load[i].data, 0)
    correct += predicted.eq(labels_load[i].data).cpu().sum().  ###error in this line
 
    total += labels_load[i].size(0)


accuracy = 100.*correct.float()/total

But it gives this error in the line for calculating correct :
RuntimeError: The size of tensor a (10) must match the size of tensor b (2) at non-singleton dimension 1.