def test_save_hyperparameters_ignore(base_class):
    """Test if `save_hyperparameter` applies the ignore list correctly during initialization."""

    class PLSubclass(base_class):
        def __init__(self, learning_rate=1e-3, optimizer="adam"):
            super().__init__()
            self.save_hyperparameters(ignore=["learning_rate"])

    pl_instance = PLSubclass(learning_rate=0.01, optimizer="sgd")
    assert pl_instance.hparams == {"optimizer": "sgd"}
Test if `save_hyperparameter` applies the ignore list correctly during initialization.
tests/tests_pytorch/models/test_hparams.py