code: def create_lighting_evaluator() -> LightningEvaluator:
      pl_trainer = nni.trace(pl.Trainer)(
          accelerator="auto",
          devices=1,
          max_epochs=1,
          max_steps=50,
          logger=TensorBoardLogger(
              Path(__file__).parent.parent / "lightning_logs",
              name="resnet",
          ),
      )
      pl_trainer.num_sanity_val_steps = 0
      pl_data = nni.trace(MNISTDataModule)(data_dir="data/mnist")
      evaluator = LightningEvaluator(
          pl_trainer, pl_data, dummy_input=torch.rand(8, 1, 28, 28)
      )
      return evaluator
  
file_path: nni/test/algo/compression/assets/simple_mnist/simple_evaluator.py
imports: from __future__ import annotations
  from pathlib import Path
  import torch
  from torch.optim.lr_scheduler import ExponentialLR
  import pytorch_lightning
  from pytorch_lightning.loggers import TensorBoardLogger
  import nni
  from nni.compression.utils import LightningEvaluator, TorchEvaluator
  from .simple_torch_model import training_model, evaluating_model, training_step
  from .simple_lightning_model import MNISTDataModule
  from ..common import device
label_desc: Use image node_id 1 for calling a global function with example usage: create_lighting_evaluator() and returns: evaluator