class_docstr: A wrapper LightningMoudle for common PyTorch models.
  
  This class implements common methods in LightningModule, so that classic pytorch
  supervised learning model only needs to supply module, loss and optimizer to create
  a LightningModule.
docstr: Compile a LightningMoudle withloss, optimizer, metrics, schedulers.
  
  :param loss:        A torch loss function.
  :param optimizer:   A torch optimizer.
  :param scheduler:   A torch scheduler.
  :param metrics:     A list of metrics to calculate accuracy of the model.
docstr_tok: ["Compile","a","LightningMoudle","withloss",",","optimizer",",","metrics",",","schedulers",".",":","param","loss",":","A","torch","loss","function",".",":","param","optimizer",":","A","torch","optimizer",".",":","param","scheduler",":","A","torch","scheduler",".",":","param","metrics",":","A","list","of","metrics","to","calculate","accuracy","of","the","model","."]
code: def compile(
      self,
      loss: _Loss = None,
      optimizer: Optimizer = None,
      scheduler: _LRScheduler = None,
      metrics: List[Metric] = None,
  ):
      """
      Compile a LightningMoudle withloss, optimizer, metrics, schedulers.
  
      :param loss:        A torch loss function.
      :param optimizer:   A torch optimizer.
      :param scheduler:   A torch scheduler.
      :param metrics:     A list of metrics to calculate accuracy of the model.
      """
      if loss is not None:
          self.loss = loss
      if optimizer is not None:
          self.optimizer = optimizer
      if scheduler is not None:
          self.scheduler = scheduler
      if metrics is not None:
          self.metrics = metrics
  
imports: from collections import OrderedDict
  import inspect
  from typing import List
  from torchmetrics.metric import Metric
  import pytorch_lightning
  from torch import nn, Tensor, fx
  from torch.nn.modules.loss import _Loss
  from torch.optim import Optimizer
  from torch.optim.lr_scheduler import _LRScheduler
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 5 for calling the LightningModule obj's underlying member method code with example usage: obj.compile(loss, optimizer, scheduler, metrics) without return types