class_docstr: Implementation of a configurable command line tool for pytorch-lightning.
class_docstr_tok: ["Implementation","of","a","configurable","command","line","tool","for","pytorch-lightning","."]
docstr: Override to customize the :meth:`~lightning.pytorch.core.LightningModule.configure_optimizers` method.
  
  Args:
      lightning_module: A reference to the model.
      optimizer: The optimizer.
      lr_scheduler: The learning rate scheduler (if used).
code: def configure_optimizers(
      lightning_module: LightningModule,
      optimizer: Optimizer,
      lr_scheduler: Optional[LRSchedulerTypeUnion] = None,
  ) -> Any:
      """Override to customize the :meth:`~lightning.pytorch.core.LightningModule.configure_optimizers` method.
  
      Args:
          lightning_module: A reference to the model.
          optimizer: The optimizer.
          lr_scheduler: The learning rate scheduler (if used).
  
      """
      if lr_scheduler is None:
          return optimizer
      if isinstance(lr_scheduler, ReduceLROnPlateau):
          return {
              "optimizer": optimizer,
              "lr_scheduler": {
                  "scheduler": lr_scheduler,
                  "monitor": lr_scheduler.monitor,
              },
          }
      return [optimizer], [lr_scheduler]
  
imports: import os
  import sys
  from functools import partial, update_wrapper
  from types import MethodType
  from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union
  import torch
  from lightning_utilities.core.imports import RequirementCache
  from lightning_utilities.core.rank_zero import _warn
  from torch.optim import Optimizer
  from typing_extensions import override
  import lightning.pytorch
  from lightning.fabric.utilities.cloud_io import get_filesystem
  from lightning.fabric.utilities.types import _TORCH_LRSCHEDULER
  from lightning.pytorch import Callback, LightningDataModule, LightningModule, Trainer, seed_everything
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.model_helpers import is_overridden
  from lightning.pytorch.utilities.rank_zero import rank_zero_warn
label_desc: Use image node_id 19 for calling the LightningCLI obj's underlying member method code with example usage: obj.configure_optimizers(lightning_module, optimizer, lr_scheduler) and returns: list,  list, optimizer, dict