class_docstr: A Wrapper to shield user from Optuna specific configurations and API      Later may support other HPO search engines.
class_docstr_tok: ["A","Wrapper","to","shield","user","from","Optuna","specific","configurations","and","API","Later","may","support","other","HPO","search","engines","."]
docstr: Instantiate auto objects in kwargs with trial params at runtime.
  
  Note the params are replaced IN-PLACE
docstr_tok: ["Instantiate","auto","objects","in","kwargs","with","trial","params","at","runtime",".","Note","the","params","are","replaced","IN-PLACE"]
code: def instantiate_param(trial, kwargs, arg_name):
      """
      Instantiate auto objects in kwargs with trial params at runtime.
  
      Note the params are replaced IN-PLACE
      """
      # instantiate auto objects in runtime params a
      v = kwargs.get(arg_name, None)
  
      if not v:
          return kwargs
  
      if not isinstance(v, Space):
          value = v
      elif isinstance(v, AutoObject):
          value = OptunaBackend.instantiate(trial, v)
      else:
          pobj = SingleParam(arg_name, v)
          config = OptunaBackend.get_hpo_config(trial, pobj.cs)
          value = pobj.sample(**config)
  
      kwargs[arg_name] = value
      return kwargs
  
file_path: BigDL/python/nano/src/bigdl/nano/deps/automl/optuna_backend.py
imports: from bigdl.nano.automl.hpo.backend import PrunerType, SamplerType
  from bigdl.nano.utils.common import invalidInputError
  from bigdl.nano.automl.hpo.space import SimpleSpace, NestedSpace, AutoObject
  from bigdl.nano.automl.hpo.space import AutoObject, Space, SingleParam, _get_hp_prefix
  import optuna
label_desc: Use image node_id 5 for calling the OptunaBackend obj's underlying member method code with example usage: obj.instantiate_param(trial, kwargs, arg_name) and returns: kwargs, kwargs