Skip to content

Commit

Permalink
only example code insert without using original tensor code
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfeiBai committed Feb 29, 2024
1 parent 1ca8cc8 commit 0b2e507
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test_train_mp_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ def test_loop_fn(loader):
test_device_loader = pl.MpDeviceLoader(test_loader, device)
accuracy, max_accuracy = 0.0, 0.0
for epoch in range(1, flags.num_epochs + 1):
xm.master_print('Epoch {} train begin {}') # .format(epoch, test_utils.now()))
xm.master_print('Epoch {} train begin {}'.format(epoch, test_utils.now()))
train_loop_fn(train_device_loader, epoch)
xm.master_print('Epoch {} train end {}') # .format(epoch, test_utils.now()))
xm.master_print('Epoch {} train end {}'.format(epoch, test_utils.now()))

accuracy = test_loop_fn(test_device_loader)
xm.master_print('Epoch {} test end {}, Accuracy={:.2f}') # .format(
xm.master_print('Epoch {} test end {}, Accuracy={:.2f}'.format(
epoch, test_utils.now(), accuracy))
max_accuracy = max(accuracy, max_accuracy)
test_utils.write_to_summary(
Expand Down

0 comments on commit 0b2e507

Please sign in to comment.