code: def load_model(
      filepath,
      custom_optimizers=None,
      custom_objects=None,
      compression=Compression.none,
      legacy_opts=False,
  ):
      """
      Loads a saved Keras model with a Horovod DistributedOptimizer.
  
      The DistributedOptimizer will wrap the underlying optimizer used to train
      the saved model, so that the optimizer state (params and weights) will
      be picked up for retraining.
  
      By default, all optimizers in the module `keras.optimizers` will be loaded
      and wrapped without needing to specify any `custom_optimizers` or
      `custom_objects`.
  
      Arguments:
          filepath: One of the following:
              - string, path to the saved model, or
              - h5py.File object from which to load the model
          custom_optimizers: Optional list of Optimizer subclasses to support
              during loading.
          custom_objects: Optional dictionary mapping names (strings) to custom
              classes or functions to be considered during deserialization.
          compression: Compression algorithm used to reduce the amount of data
                       sent and received by each worker node.  Defaults to not
                       using compression.
          legacy_opts: If True, model uses tf.keras.optimizers.legacy.* optimizers
  
      Returns:
          A Keras model instance.
  
      Raises:
          ImportError: If h5py is not available.
          ValueError: In case of an invalid savefile.
      """
  
      def wrap_optimizer(cls):
          return lambda **kwargs: DistributedOptimizer(
              cls(**kwargs), compression=compression
          )
  
      return _impl.load_model(
          keras,
          wrap_optimizer,
          filepath,
          custom_optimizers,
          custom_objects,
          legacy_opts,
      )
  
imports: import inspect
  import warnings
  from packaging import version
  import tensorflow
  from tensorflow import keras
  from horovod.common.util import is_version_greater_equal_than
  from horovod.tensorflow import init
  from horovod.tensorflow import shutdown
  from horovod.tensorflow import is_initialized, start_timeline, stop_timeline
  from horovod.tensorflow import size, local_size, cross_size, rank, local_rank, cross_rank
  from horovod.tensorflow import mpi_threads_supported, mpi_enabled, mpi_built
  from horovod.tensorflow import gloo_enabled, gloo_built
  from horovod.tensorflow.mpi_ops import ProcessSet, global_process_set, add_process_set, remove_process_set
  from horovod.tensorflow import nccl_built, ddl_built, ccl_built, cuda_built, rocm_built
  from horovod.tensorflow import Average, Sum
  from horovod.tensorflow.compression import Compression
  import horovod._keras
  from horovod.tensorflow.keras import callbacks, elastic
label_desc: Use image node_id 7 for calling a global function with example usage: load_model(filepath, custom_optimizers, custom_objects, compression, legacy_opts) and returns: _impl, function