Open NidhiKan opened 2 years ago
def test(model, test_loader, args): model.eval() test_loss = 0 correct = 0 for x, y in testloader: y = torch.zeros(y.size(0), 10).scatter(1, y.view(-1, 1), 1.) x, y = Variable(x.cuda(), volatile=True), Variable(y.cuda())
plz check the for loop statements. how the first line of y will be changed for 7 number of classes.
def test(model, test_loader, args): model.eval() test_loss = 0 correct = 0 for x, y in testloader: y = torch.zeros(y.size(0), 10).scatter(1, y.view(-1, 1), 1.) x, y = Variable(x.cuda(), volatile=True), Variable(y.cuda())
plz check the for loop statements. how the first line of y will be changed for 7 number of classes.