def _pad_tensor(tensor, field, padding_size):
  """Pads a tensor on the first dimensions with the padding size.

  Args:
    tensor: tf.Tensor of size [batch_dim, x1, ..., xn].
    field: Text, the field of `graphs.GraphsTuple` to pad.
    padding_size: A tuple representing the size of padding of the graph.

  Returns:
    A tf.Tensor of size [batch_dim + padding, x1, ..., xn] padded with zeros.
  """
  padding = _get_field_size_from_size_tuple(padding_size, field)
  padding_tensor = tf.zeros(
      [padding] + tensor.shape.as_list()[1:],
      dtype=tensor.dtype,
      name="pad_zeros_{}".format(field))
  return tf.concat((tensor, padding_tensor), axis=0)
Pads a tensor on the first dimensions with the padding size.

  Args:
    tensor: tf.Tensor of size [batch_dim, x1, ..., xn].
    field: Text, the field of `graphs.GraphsTuple` to pad.
    padding_size: A tuple representing the size of padding of the graph.

  Returns:
    A tf.Tensor of size [batch_dim + padding, x1, ..., xn] padded with zeros.
  
graph_nets/utils_tf.py