Fix typo in _validate_scheduler_optimizer() (#9886)

This commit is contained in:
kingyiusuen 2021-10-11 02:16:17 -05:00 committed by GitHub
parent c395766300
commit 8740c801bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -230,7 +230,7 @@ def _validate_optim_conf(optim_conf: Dict[str, Any]) -> None:
def _validate_scheduler_optimizer(optimizers, lr_schedulers):
if any(sch["scheduler"].optimizer not in optimizers for sch in lr_schedulers):
raise MisconfigurationException(
"Some schedulers are attatched with an optimizer that wasn't returned from `configure_optimizers`."
"Some schedulers are attached with an optimizer that wasn't returned from `configure_optimizers`."
)

View File

@ -490,7 +490,7 @@ def test_lr_scheduler_with_no_actual_scheduler_raises(tmpdir):
def test_invalid_optimizer_in_scheduler(tmpdir):
"""Test exception when optimizer attatched to lr_schedulers wasn't returned."""
"""Test exception when optimizer attached to lr_schedulers wasn't returned."""
class InvalidOptimizerModel(BoringModel):
def configure_optimizers(self):
@ -501,7 +501,7 @@ def test_invalid_optimizer_in_scheduler(tmpdir):
model = InvalidOptimizerModel()
trainer = Trainer(default_root_dir=tmpdir, fast_dev_run=True)
with pytest.raises(MisconfigurationException, match="attatched with an optimizer that wasn't returned"):
with pytest.raises(MisconfigurationException, match="attached with an optimizer that wasn't returned"):
trainer.fit(model)