29bcf309848b9c5ff95ab0d6dd0f12b7ae28f9b4,tests/core/test_datamodules.py,,test_full_loop_dp,#Any#,350

Before Change


def test_full_loop_dp(tmpdir):
    reset_seed()

    dm = TrialMNISTDataModule(tmpdir)

    model = EvalModelTemplate()

    trainer = Trainer(
        default_root_dir=tmpdir,
        max_epochs=3,
        weights_summary=None,
        accelerator="dp",
        gpus=2,
        deterministic=True,
    )

    // fit model
    trainer.fit(model, dm)
    assert trainer.state == TrainerState.FINISHED, f"Training failed with {trainer.state}"

    // test
    result = trainer.test(datamodule=dm)
    result = result[0]
    assert result["test_acc"] > 0.8


@pytest.mark.skipif(torch.cuda.device_count() < 1, reason="test requires multi-GPU machine")

After Change


    // fit model
    result = trainer.fit(model, dm)
    assert trainer.state == TrainerState.FINISHED, f"Training failed with {trainer.state}"
    assert result

    // test
    result = trainer.test(datamodule=dm)
    // TODO: add end-to-end test
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: williamFalcon/pytorch-lightning
Commit Name: 29bcf309848b9c5ff95ab0d6dd0f12b7ae28f9b4
Time: 2021-01-12
Author: rohitgr1998@gmail.com
File Name: tests/core/test_datamodules.py
Class Name:
Method Name: test_full_loop_dp


Project Name: williamFalcon/pytorch-lightning
Commit Name: 29bcf309848b9c5ff95ab0d6dd0f12b7ae28f9b4
Time: 2021-01-12
Author: rohitgr1998@gmail.com
File Name: tests/core/test_datamodules.py
Class Name:
Method Name: test_full_loop_single_gpu


Project Name: williamFalcon/pytorch-lightning
Commit Name: 29bcf309848b9c5ff95ab0d6dd0f12b7ae28f9b4
Time: 2021-01-12
Author: rohitgr1998@gmail.com
File Name: tests/core/test_datamodules.py
Class Name:
Method Name: test_full_loop