code: def _allgather_grad(op, grad):
      """Gradient for allgather op.
  
      Args:
        op: An operation.
        grad: `Tensor` gradient with respect to the output of the op.
  
      Returns:
        The gradient with respect to the input of the op.
      """
      grad = _allreduce(grad)
  
      with tf.device("/cpu:0"):
          # Keep the tensor of split sizes on CPU.
          x = op.inputs[0]
          d0 = x.get_shape().as_list()[0]
          d = tf.convert_to_tensor([d0], dtype=tf.int32)
  
          s = size()
          d = tf.reshape(allgather(d), [s])
  
      splits = tf.split(grad, num_or_size_splits=d, axis=0)
      return splits[rank()]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import re
  import tensorflow
  from tensorflow.python.framework import load_library
  from tensorflow.python.framework import ops
  from tensorflow.python.platform import resource_loader
  from bluefog.common.basics import BlueFogBasics
  from bluefog.common.util import get_ext_suffix
  from bluefog.tensorflow.util import _executing_eagerly
label_desc: Use image node_id 10 for calling a global function with example usage: _allgather_grad(op, grad) and returns: splits