Skip to content

Commit

Permalink
Merge branch 'update-exmaples-versions' of https://github.com/adap/fl…
Browse files Browse the repository at this point in the history
…ower into update-exmaples-versions
  • Loading branch information
dstripelis committed Jan 31, 2025
2 parents ab2c922 + 8388f01 commit d3e2f1b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/embedded-devices/embeddedexample/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def train(net, trainloader, valloader, epochs, learning_rate, device):

def test(net, testloader, device):
"""Validate the model on the test set."""
net.to(device) # move model to GPU if available
net.eval()
criterion = torch.nn.CrossEntropyLoss()
correct, loss = 0, 0.0
with torch.no_grad():
Expand Down

0 comments on commit d3e2f1b

Please sign in to comment.