Skip to content

Commit

Permalink
Test debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca committed Aug 6, 2022
1 parent 04585e2 commit b51de20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/tests_pytorch/core/test_metric_result_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def lightning_log(fx, *args, **kwargs):
lightning_log("training_step", "c_1", {"1": c, "2": c}, on_step=True, on_epoch=False)

batch_log = result.metrics(on_step=True)["log"]
# FIXME
assert set(batch_log) == {"a_step", "c", "a_1_step", "c_1"}
assert set(batch_log["c_1"]) == {"1", "2"}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,12 @@ def on_train_epoch_end(self, trainer, pl_module):
"accelerator",
[
pytest.param("gpu", marks=RunIf(min_cuda_gpus=1)),
"cpu",
],
)
def test_metric_are_properly_reduced(tmpdir, accelerator):
class TestingModel(BoringModel):
def __init__(self, *args, **kwargs) -> None:
def __init__(self) -> None:
super().__init__()
self.val_acc = Accuracy()

Expand All @@ -592,7 +593,6 @@ def validation_step(self, batch, batch_idx):
return super().validation_step(batch, batch_idx)

early_stop = EarlyStopping(monitor="val_acc", mode="max")

checkpoint = ModelCheckpoint(monitor="val_acc", save_last=True, save_top_k=2, mode="max")

model = TestingModel()
Expand Down

0 comments on commit b51de20

Please sign in to comment.