class_docstr: A Minin object to add hpo related methods to models.
  
  It is used to add hpo related search methods onto
  tf.keras.Sequential, tf.keras.Model, as well as custom
      model subclassing from tf.keras.Model.
class_docstr_tok: ["A","Minin","object","to","add","hpo","related","methods","to","models",".","It","is","used","to","add","hpo","related","search","methods","onto","tf.keras.Sequential",",","tf.keras.Model",",","as","well","as","custom","model","subclassing","from","tf.keras.Model","."]
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
  
imports: import copy
  import warnings
  from .objective import Objective
  from bigdl.nano.automl.hpo.backend import create_hpo_backend
  from bigdl.nano.automl.hpo.search import _search_summary, _end_search, _create_study, _validate_args, _strip_val_prefix, _prepare_args
  from bigdl.nano.automl.hpo.space import AutoObject
  from bigdl.nano.utils.common import invalidInputError
  from bigdl.nano.automl.utils.parallel import run_parallel
  import math
label_desc: Use image node_id 13 for calling the HPOMixin obj's underlying member method code with example usage: obj.end_search(use_trial_id) without return types