code: def DistributedOptimizer(
      optimizer,
      name=None,
      device_dense="",
      device_sparse="",
      compression=Compression.none,
      sparse_as_dense=False,
  ):
      """
      An optimizer that wraps another keras.optimizers.Optimizer, using an push_pull to
      average gradient values before applying gradients to model weights.
      Args:
          optimizer: Optimizer to use for computing gradients and applying updates.
          name: Optional name prefix for the operations created when applying
                gradients. Defaults to "Distributed" followed by the provided
                optimizer type.
          device_dense: Device to be used for dense tensors. Uses GPU by default.
          device_sparse: Device to be used for sparse tensors. Uses GPU by default.
          compression: Compression algorithm used to reduce the amount of data
                       sent and received by each worker node.  Defaults to not
                       using compression.
          sparse_as_dense: Treat all sparse gradients as dense tensors.  This can
                           help improve performance and memory utilization if
                           the original sparse gradient has high density.
                           Defaults to false.
      """
      return _impl.create_distributed_optimizer(
          keras,
          optimizer,
          name,
          device_dense,
          device_sparse,
          compression,
          sparse_as_dense,
      )
  
file_path: byteps/byteps/tensorflow/keras/__init__.py
imports: import inspect
  import tensorflow
  from distutils.version import LooseVersion
  from byteps.tensorflow import init
  from byteps.tensorflow import shutdown
  from byteps.tensorflow import size
  from byteps.tensorflow import local_size
  from byteps.tensorflow import rank
  from byteps.tensorflow import local_rank
  from byteps.tensorflow import Compression
  import byteps._keras
  from byteps.tensorflow.keras import callbacks
label_desc: Use image node_id 1 for calling a global function with example usage: DistributedOptimizer(optimizer, name, device_dense, device_sparse, compression, sparse_as_dense) and returns: _impl