class_docstr: Base context class that contains runtime information for any Determined
  workflow that uses the ``tf.keras`` API.
class_docstr_tok: ["Base","context","class","that","contains","runtime","information","for","any","Determined","workflow","that","uses","the","``","tf.keras","``","API","."]
code: def _process_optimizer_from_compile(
      self, optimizer: tf.keras.optimizers.Optimizer
  ) -> tf.keras.optimizers.Optimizer:
      logger.debug(f"Processing compiled optimizer {optimizer}.")
      if self.distributed.size == 1:
          self._compiled_optimizer = optimizer
          return optimizer
  
      if len(self._wrapped_optimizers) > 0:
          logger.debug(
              "Skipping wrapping optimizer that is part of the compile "
              "call as the user has already used the wrap_optimizer() API."
          )
          wrapped_optimizer = optimizer
      else:
          wrapped_optimizer = (
              self._get_horovod_optimizer_if_using_horovod(
                  optimizer=optimizer,
              )
          )
      self._compiled_optimizer = wrapped_optimizer
  
      return wrapped_optimizer
  
imports: import inspect
  import logging
  from typing import Any, Callable, Dict, List, NamedTuple, Optional, Union, cast
  import tensorflow
  import determined
  from determined import errors, keras, util
  from determined.common import check
  from determined.horovod import hvd
label_desc: Use image node_id 9 for calling the TFKerasTrialContext obj's underlying member method code with example usage: obj._process_optimizer_from_compile(optimizer) and returns: wrapped_optimizer, optimizer