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: Define a single validation step.
docstr_tok: ["Define","a","single","validation","step","."]
code: def validation_step(self, batch, batch_idx):
      """Define a single validation step."""
      y_hat = self(*batch[: self._nargs])
      if self.loss:
          loss = self.loss(
              y_hat, batch[-1]
          )  # use last output as target
          self.log(
              "val/loss",
              loss,
              on_epoch=True,
              prog_bar=True,
              logger=True,
          )
      if self.metrics:
          acc = {
              "val/{}_{}".format(type(metric).__name__, i): metric(
                  y_hat, batch[-1]
              )
              for i, metric in enumerate(self.metrics)
          }
          self.log_dict(acc, on_epoch=True, prog_bar=True, logger=True)
  
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 9 for calling the LightningModule obj's underlying member method code with example usage: obj.validation_step(batch, batch_idx) without return types