class_docstr: The Tuning objective for HPO.
code: def _auto_acceleration(self, model, scores):
      # for compatibility with metric of Chronos, remove the prefix before '/'
      format_target_metric = _remove_metric_prefix(self.target_metric)
      Score = namedtuple("Score", format_target_metric)
      best_score = Score(*scores)
      optim_model_type = "original"
      model.eval()
  
      # here we suppose nn.model is attached to plmodel by attribute "model"
      original_model = model.model
      # may define a default_range later
      for optimization in ["openvino", "onnxruntime", "jit"]:
          # may enable more optimizations later
          try:
              if optimization == "jit":
                  optim_model = InferenceOptimizer.trace(
                      original_model,
                      input_sample=self.input_sample,
                      accelerator=optimization,
                      use_ipex=True,
                      channels_last=False,
                  )
              else:
                  optim_model = InferenceOptimizer.trace(
                      original_model,
                      input_sample=self.input_sample,
                      accelerator=optimization,
                  )
          except Exception:
              # some optimizations may fail, just skip and try next
              continue
          model.model = optim_model
          model.forward_args = optim_model.forward_args
          self.searcher._validate(model, self.val_dataloaders)
          optim_score = []
          for metric in self.target_metric:
              score = self.searcher.trainer.callback_metrics[
                  metric
              ].item()
              optim_score.append(score)
          optim_score = Score(*optim_score)
          # Here, we use usable to represent whether the optimized model can get smaller latency
          # with other performance indicators basically unchanged
          usable = True
          for metric in format_target_metric:
              if metric != "latency":
                  if abs(
                      getattr(optim_score, metric)
                      - getattr(best_score, metric)
                  ) >= 0.01 * getattr(best_score, metric):
                      usable = False
                      break
              else:
                  if optim_score.latency > best_score.latency:
                      usable = False
                      break
          if usable:
              best_score = optim_score
              optim_model_type = optimization
      scores = tuple(best_score)
      return scores, optim_model_type
  
imports: from collections import namedtuple
  from typing import Optional, Union
  import pytorch_lightning
  from pytorch_lightning.utilities.types import EVAL_DATALOADERS, TRAIN_DATALOADERS
  from pytorch_lightning.utilities import rank_zero_deprecation
  from pytorch_lightning.core.datamodule import LightningDataModule
  from bigdl.nano.pytorch import InferenceOptimizer
  from bigdl.nano.automl.hpo.backend import create_pl_pruning_callback
  from bigdl.nano.utils.common import invalidInputError
  from ._helper import LatencyCallback, _remove_metric_prefix, BestMetricCallback
  import inspect
  import copy
label_desc: Use image node_id 6 for calling the Objective obj's underlying member method code with example usage: obj._auto_acceleration(model, scores) and returns: scores,  optim_model_type