keras/src/backend/tensorflow/trainer.py/_collective_all_reduce_multi_worker
def _collective_all_reduce_multi_worker(strategy):
    return (
        isinstance(strategy, tf.distribute.MultiWorkerMirroredStrategy)
    ) and strategy.extended._in_multi_worker_mode()