class_docstr: Tuner class for Keras models.
  
  This is the base `Tuner` class for all tuners for Keras models. It manages
  the building, training, evaluation and saving of the Keras models. New
  tuners can be created by subclassing the class.
  
  All Keras related logics are in `Tuner.run_trial()` and its subroutines.
  When subclassing `Tuner`, if not calling `super().run_trial()`, it can tune
  anything.
  
  Args:
      oracle: Instance of `Oracle` class.
      hypermodel: Instance of `HyperModel` class (or callable that takes
          hyperparameters and returns a `Model` instance). It is optional
          when `Tuner.run_trial()` is overriden and does not use
          `self.hypermodel`.
      max_model_size: Integer, maximum number of scalars in the parameters of
          a model. Models larger than this are rejected.
      optimizer: Optional optimizer. It is used to override the `optimizer`
          argument in the `compile` step for the models. If the hypermodel
          does not compile the models it generates, then this argument must be
          specified.
      loss: Optional loss. May be used to override the `loss` argument in the
          `compile` step for the models. If the hypermodel does not compile
          the models it generates, then this argument must be specified.
      metrics: Optional metrics. May be used to override the `metrics`
          argument in the `compile` step for the models. If the hypermodel
          does not compile the models it generates, then this argument must
          be specified.
      distribution_strategy: Optional instance of `tf.distribute.Strategy`.
          If specified, each trial will run under this scope. For example,
          `tf.distribute.MirroredStrategy(['/gpu:0', '/gpu:1'])` will run
          each trial on two GPUs. Currently only single-worker strategies are
          supported.
      directory: A string, the relative path to the working directory.
      project_name: A string, the name to use as prefix for files saved by
          this `Tuner`.
      tuner_id: Optional string, used as the ID of this `Tuner`.
      overwrite: Boolean, defaults to `False`. If `False`, reloads an
          existing project of the same name if one is found. Otherwise,
          overwrites the project.
      executions_per_trial: Integer, the number of executions (training a
          model from scratch, starting from a new initialization) to run per
          trial (model configuration). Model metrics may vary greatly
          depending on random initialization, hence it is often a good idea
          to run several executions per trial in order to evaluate the
          performance of a given set of hyperparameter values.
      **kwargs: Arguments for `BaseTuner`.
  
  Attributes:
      remaining_trials: Number of trials remaining, `None` if `max_trials` is
          not set. This is useful when resuming a previously stopped search.
code: def _build_hypermodel(self, hp):
      with maybe_distribute(self.distribution_strategy):
          model = self.hypermodel.build(hp)
          self._override_compile_args(model)
          return model
  
imports: import contextlib
  import copy
  import gc
  import math
  import os
  import numpy
  from keras_tuner import backend
  from keras_tuner import errors
  from keras_tuner import utils
  from keras_tuner.api_export import keras_tuner_export
  from keras_tuner.backend import config
  from keras_tuner.backend import keras
  from keras_tuner.engine import base_tuner
  from keras_tuner.engine import tuner_utils
label_desc: Use image node_id 2 for calling the Tuner obj's underlying member method code with example usage: obj._build_hypermodel(hp) and returns: model