class_docstr: A global configuration object for HPO.
  
  To access the hpo config, use "bigdl.nano.automl.hpo_config".
  E.g., to enable hpo tf, use "bigd.nano.automl.hpo_config.enable_hpo_tf()"
class_docstr_tok: ["A","global","configuration","object","for","HPO",".","To","access","the","hpo","config",",","use","``","bigdl.nano.automl.hpo_config","''",".","E.g.",",","to","enable","hpo","tf",",","use","``","bigd.nano.automl.hpo_config.enable_hpo_tf","(",")","''"]
code: def _clean_nano_tf_modules(self):
      # TODO check all decorated objects and remove them
      # especially for dynamically added layers and activations
      self.added_tf_layers = self.added_tf_layers or []
      self.added_tf_activations = self.added_tf_activations or []
  
      # clean nano tf layers
      import bigdl.nano.tf.keras.layers as nano_layers
  
      clean_modules_simple(
          vars(nano_layers), subcomponents=self.added_tf_layers
      )
      # restore non-decorated layers in nano, e.g. Embedding
      self._restore_existing_components(
          vars(nano_layers), namespace="layers"
      )
  
      # clean nano nano_activations
      import bigdl.nano.tf.keras.activations
  
      clean_modules_simple(
          vars(bigdl.nano.tf.keras.activations),
          subcomponents=self.added_tf_activations,
      )
  
      # clean up decorated tf.cast
      import bigdl.nano.tf
  
      clean_modules_simple(
          vars(bigdl.nano.tf), subcomponents=HPOConfig.TF_FUNCS
      )
  
      # clean up tf.keras.Input
      import bigdl.nano.tf.keras
  
      clean_modules_simple(
          vars(bigdl.nano.tf.keras),
          subcomponents=HPOConfig.TF_KERAS_FUNCS,
      )
  
      # clean up tf.keras.Input
      import bigdl.nano.tf.keras
  
      clean_modules_simple(
          vars(bigdl.nano.tf.keras),
          subcomponents=HPOConfig.TF_KERAS_FUNCS,
      )
  
      # clean up optimizers
      import bigdl.nano.tf.optimizers as nano_optimizers
  
      all_optimzers = (
          HPOConfig.TF_OPTIMIZERS + HPOConfig.NANO_DEFINED_TF_OPTIMIZERS
      )
      clean_modules_simple(
          vars(nano_optimizers), subcomponents=all_optimzers
      )
      # restore non-decorated layers in nano, e.g. SparseAdam
      self._restore_existing_components(
          vars(nano_optimizers), namespace="optimizers"
      )
  
file_path: BigDL/python/nano/src/bigdl/nano/automl/hpo/config.py
imports: import importlib
  from bigdl.nano.automl.utils.register_modules import COMPONENT_TYPE, register_module, register_module_simple, clean_modules_simple
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 15 for calling the HPOConfig obj's underlying member method code with example usage: obj._clean_nano_tf_modules() without return types