def test_scale_batch_size_no_trials(tmp_path):
    """Check the result is correct even when no trials are run."""
    trainer = Trainer(default_root_dir=tmp_path, max_epochs=1, limit_val_batches=1, limit_train_batches=1)
    tuner = Tuner(trainer)
    model = BatchSizeModel(batch_size=2)
    result = tuner.scale_batch_size(model, max_trials=0, mode="power")
    assert result == 2
Check the result is correct even when no trials are run.
tests/tests_pytorch/tuner/test_scale_batch_size.py