In process of calculate the correct rate,always occuring the error:
eq received an invalid combination of arguments - got (Variable), but expected one of:

(int value)
didn’t match because some of the arguments have invalid types: (Variable)
(torch.cuda.LongTensor other)
didn’t match because some of the arguments have invalid types: (Variable)

my code like this:
for step_test, (test_x, test_y) in enumerate(test_loader):
test_x = Variable(test_x,volatile=True).cuda()
test_y=Variable(test_y).cuda()
test_output = densenet(test_x)
pred =output.data.max(1)[1]
correct +=(pred==test_y).cpu().sum()
total=len(test_loader.dataset)
accuracy=100.*correct/float(total)
like correct +=(pred==test_y).cpu().sum(),have error?
Help me!!!
THANK YOU VERY MUCH!!!