code: def tfmodel(**kwvars):
      """
      Decorator for a Tensorflow model that registers its arguments as hyperparameters.
  
      Used for custom keras model subclassing from tf.keras.Model.
      Each hyperparameter may take a fixed value or be a searchable space
      (e.g. hpo.space.Int, hpo.space.Categorical).
  
      :return: a TFAutoMdl object. The instantiation of the class object is delayed
               until TFAutoMdl.sample() is called (usually in each trial). The difference
               between a TFAutoMdl and a AutoCls is TFAutoMdl has search and search_summary
               methods.
  
      """
      from bigdl.nano.automl.tf.mixin import HPOMixin
  
      def registered_class(Cls):
          objCls = obj(**kwvars)(Cls)
  
          @proxy_methods
          class TFAutoMdl(HPOMixin, Cls):
              def __init__(self, **kwargs):
                  self.kwargs = kwargs
                  self._lazyobj = objCls(**kwargs)
                  # generate a default config for the super class
                  default_config = (
                      self._lazyobj.cs.get_default_configuration().get_dictionary()
                  )
                  super_kwargs = copy.deepcopy(self.kwargs)
                  kwspaces = copy.deepcopy(self._lazyobj.kwspaces)
                  for k, v in super_kwargs.items():
                      if k in kwspaces and isinstance(
                          kwspaces[k], NestedSpace
                      ):
                          sub_config = _strip_config_space(
                              default_config, prefix=k
                          )
                          super_kwargs[k] = kwspaces[k].sample(
                              **sub_config
                          )
                      elif k in default_config:
                          super_kwargs[k] = default_config[k]
                  super().__init__(**super_kwargs)
  
              def __repr__(self):
                  return "TFAutoMdl -- " + Cls.__name__
  
              def _model_build(self, trial):
                  # override _model_build to build
                  # the model directly instead of using
                  # modeld_init and model_compile
                  model = self.backend.instantiate(trial, self._lazyobj)
                  self._model_compile(model, trial)
                  return model
  
              def _get_model_builder_args(self):
                  return {
                      "lazyobj": self._lazyobj,
                      "compile_args": self.compile_args,
                      "compile_kwargs": self.compile_kwargs,
                      "backend": self.backend,
                  }
  
              @staticmethod
              def _get_model_builder(
                  lazyobj, compile_args, compile_kwargs, backend
              ):
                  def model_builder(trial):
                      model = backend.instantiate(trial, lazyobj)
                      # self._model_compile(model, trial)
                      # instantiate optimizers if it is autoobj
                      optimizer = compile_kwargs.get("optimizer", None)
                      if optimizer and isinstance(
                          optimizer, AutoObject
                      ):
                          optimizer = backend.instantiate(
                              trial, optimizer
                          )
                          compile_kwargs["optimizer"] = optimizer
                      model.compile(*compile_args, **compile_kwargs)
                      return model
  
                  return model_builder
  
          return TFAutoMdl
  
      return registered_class
  
imports: import copy
  import logging
  import argparse
  import functools
  from collections import OrderedDict
  import numpy
  import multiprocessing
  from .space import *
  from .space import _add_hp, _add_cs, _rm_hp, _strip_config_space, SPLITTER
  from .callgraph import CallCache
  from bigdl.nano.automl.utils import EasyDict
  from bigdl.nano.automl.utils import proxy_methods
  from bigdl.nano.automl.hpo.backend import create_hpo_backend
  from bigdl.nano.deps.automl.hpo_api import create_configuration_space
label_desc: Use image node_id 5 for calling a global function with example usage: tfmodel() and returns: registered_class, TFAutoMdl, unknown, model, dict, model_builder, model