code: def broadcast_object_fn(
      root_rank=0,
      session=None,
      name=None,
      process_set=global_process_set,
  ):
      name = name or "broadcast_object_fn"
  
      sz = tf.placeholder(tf.int32, [1], name="bcast_object_size")
      bcast_size = broadcast(
          sz, root_rank, name + ".sz", process_set=process_set
      )
  
      t = tf.placeholder(tf.uint8, [None], name="bcast_object_data")
      bcast_data = broadcast(
          t, root_rank, name + ".t", process_set=process_set
      )
  
      session = session or ops.get_default_session()
  
      def _bcast(obj):
          if rank() == root_rank:
              b = io.BytesIO()
              cloudpickle.dump(obj, b)
              t_ = bytearray(b.getvalue())
              sz_ = [len(t_)]
              session.run(bcast_size, feed_dict={sz: sz_})
          else:
              sz_ = [0]
              sz_ = session.run(bcast_size, feed_dict={sz: sz_})
              t_ = np.zeros(sz_, dtype=np.uint8)
  
          t_ = session.run(bcast_data, feed_dict={t: t_})
  
          if rank() != root_rank:
              buf = io.BytesIO(t_.tobytes())
              obj = cloudpickle.load(buf)
  
          return obj
  
      return _bcast
  
file_path: horovod/horovod/tensorflow/functions.py
imports: import io
  import cloudpickle
  import numpy
  import tensorflow
  from tensorflow.python.framework import ops
  from horovod.tensorflow.mpi_ops import allgather, broadcast, broadcast_
  from horovod.tensorflow.mpi_ops import rank, size
  from horovod.tensorflow.util import _cache, _executing_eagerly, _make_subgraph
  from horovod.common.process_sets import ProcessSet, global_process_set
label_desc: Use image node_id 5 for calling a global function with example usage: broadcast_object_fn(root_rank, session, name, process_set) and returns: _bcast, obj