def test_scheduler_initialized_with_custom_reduceonplateau():
    """Test for initialize custom scheduler with `reduce_on_plateau` argument."""

    class CustomReduceLROnPlateau:
        pass

    lr_scheduler = {"reduce_on_plateau": True, "scheduler": CustomReduceLROnPlateau(), "monitor": "my_loss"}
    config = _configure_schedulers_automatic_opt([lr_scheduler], None)
    assert isinstance(config[0].scheduler, CustomReduceLROnPlateau)
    assert config[0].reduce_on_plateau
Test for initialize custom scheduler with `reduce_on_plateau` argument.
tests/tests_pytorch/trainer/optimization/test_optimizers.py