Skip to content

Commit

Permalink
Fix quickstart-pytorch (#2659)
Browse files Browse the repository at this point in the history
  • Loading branch information
jafermarq authored Nov 29, 2023
1 parent ded72a2 commit 14c9b2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/quickstart-pytorch/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def test(net, testloader):
correct, loss = 0, 0.0
with torch.no_grad():
for batch in tqdm(testloader, "Testing"):
images = batch["img"]
labels = batch["label"]
outputs = net(images.to(DEVICE))
images = batch["img"].to(DEVICE)
labels = batch["label"].to(DEVICE)
outputs = net(images)
loss += criterion(outputs, labels).item()
correct += (torch.max(outputs.data, 1)[1] == labels).sum().item()
accuracy = correct / len(testloader.dataset)
Expand Down

0 comments on commit 14c9b2a

Please sign in to comment.