Skip to content

Commit

Permalink
added test docs
Browse files Browse the repository at this point in the history
  • Loading branch information
williamFalcon committed Jul 24, 2019
1 parent b776fce commit 8bbd65c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_exp():

def assert_ok_acc(trainer):
# this model should get 0.80+ acc
assert trainer.tng_tqdm_dic['val_acc'] > 0.80
assert trainer.tng_tqdm_dic['val_acc'] > 0.80, "model failed to get expected 0.80 validation accuracy"


def test_cpu_model():
Expand All @@ -55,11 +55,8 @@ def test_cpu_model():
)

result = trainer.fit(model)
assert result == 1, 'cpu model failed to complete'

metrics = trainer.tng_tqdm_dic
print(metrics)

assert result == 1
assert_ok_acc(trainer)


Expand All @@ -84,7 +81,7 @@ def test_single_gpu_model():

result = trainer.fit(model)

assert result == 1
assert result == 1, 'single gpu model failed to complete'
assert_ok_acc(trainer)


Expand Down Expand Up @@ -112,7 +109,7 @@ def test_multi_gpu_model_dp():

result = trainer.fit(model)

assert result == 1
assert result == 1, 'multi-gpu dp model failed to complete'
assert_ok_acc(trainer)


Expand Down Expand Up @@ -141,7 +138,7 @@ def test_multi_gpu_model_ddp():

result = trainer.fit(model)

assert result == 1
assert result == 1, 'multi-gpu ddp model failed to complete'
assert_ok_acc(trainer)


Expand Down Expand Up @@ -171,7 +168,7 @@ def test_amp_gpu_ddp():

result = trainer.fit(model)

assert result == 1
assert result == 1, 'amp + ddp model failed to complete'
assert_ok_acc(trainer)


Expand Down Expand Up @@ -201,7 +198,7 @@ def test_amp_gpu_dp():

result = trainer.fit(model)

assert result == 1
assert result == 1, 'amp + gpu model failed to complete'
assert_ok_acc(trainer)


Expand Down

0 comments on commit 8bbd65c

Please sign in to comment.