class_docstr: Hyper Parameter Searcher. A Tuner-like class.
class_docstr_tok: ["Hyper","Parameter","Searcher",".","A","Tuner-like","class","."]
docstr: Put an end to tuning.
  
  Use the specified trial or best trial to init and build the model.
  
  :param use_trial_id: int(optional) params of which trial to be used.
      Defaults to -1.
  :throw: ValueError: error when tune is not called before end_search.
docstr_tok: ["Put","an","end","to","tuning",".","Use","the","specified","trial","or","best","trial","to","init","and","build","the","model",".",":","param","use_trial_id",":","int","(","optional",")","params","of","which","trial","to","be","used",".","Defaults","to","-1.",":","throw",":","ValueError",":","error","when","tune","is","not","called","before","end_search","."]
code: def end_search(self, use_trial_id=-1):
      """
      Put an end to tuning.
  
      Use the specified trial or best trial to init and build the model.
  
      :param use_trial_id: int(optional) params of which trial to be used.
          Defaults to -1.
      :throw: ValueError: error when tune is not called before end_search.
      """
      self._lazymodel = _end_search(
          study=self.study,
          model_builder=self._model_build,
          use_trial_id=use_trial_id,
      )
      # TODO Next step: support retrive saved model instead of retrain from hparams
      self.tune_end = True
      return self._lazymodel
  
imports: from typing import Any
  import pytorch_lightning
  import copy
  import math
  from pytorch_lightning.trainer.states import TrainerFn, TrainerStatus
  from bigdl.nano.utils.common import invalidInputError
  from bigdl.nano.automl.hpo.backend import create_hpo_backend, SamplerType
  from .objective import Objective
  from ._helper import ResetCallback, CustomEvaluationLoop
  from bigdl.nano.automl.utils.parallel import run_parallel
  from bigdl.nano.automl.hpo.search import _search_summary, _end_search, _create_study, _validate_args, _prepare_args
label_desc: Use image node_id 7 for calling the HPOSearcher obj's underlying member method code with example usage: obj.end_search(use_trial_id) and returns: self