Skip to content

Commit eb3f61e

Browse files
committed
Ensure runner is terminated during types example tests
Fix pep8 non-compliance
1 parent 0a7a03f commit eb3f61e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/examples/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,4 @@ def test_example(self, example_name, language, namespace, yaml,
284284
finally:
285285
if mpi_rank == 0:
286286
example_cleanup()
287+
r.terminate()

yggdrasil/examples/pytorch1/src/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ def test(dataloader, model, loss_fn):
129129
pred.argmax(1) == y).type(torch.float).sum().item()
130130
test_loss /= num_batches
131131
correct /= size
132-
print(f"Test Error: \n Accuracy: {(100*correct):>0.1f}%, "
132+
print(f"Test Error: \n Accuracy: {(100 * correct):>0.1f}%, "
133133
f"Avg loss: {test_loss:>8f} \n")
134134

135135
epochs = 5
136136
for t in range(epochs):
137-
print(f"Epoch {t+1}\n-------------------------------")
137+
print(f"Epoch {t + 1}\n-------------------------------")
138138
train(train_dataloader, model, loss_fn, optimizer)
139139
test(test_dataloader, model, loss_fn)
140140
print("Done!")

0 commit comments

Comments
 (0)