How to switch from optimizer during training

Do you know how to use LFBGS optimizer in pytorch-lightening (issue # 3672)? I am trying to switch from ADAM to lightening using:

def on_epoch_start(self):
    if condition:
        self.trainer.accelerator_backend.setup_optimizers(self)
def configure_optimizers(self):
    if condition:
        return Adam(...)
    else:
        return LBFGS(...)