def _assert_if_space_for_first_padding_graph(
    graphs_tuple, graphs_tuple_padded_sizes):
  """Checks if a given graph can fit in the provided padded shape.

  Args:
    graphs_tuple: A `graphs.GraphsTuple` that is checked for size.
    graphs_tuple_padded_sizes: A `GraphsTupleSize` with the sized to pad to.

  Returns:
    An assertion op indicating whether there is space for the padding graph.
  """

  # Padding graph needs to have at least one graph, and at least one node,
  # but should not need extra edges, so the number of padded nodes and graphs
  # needs to be strictly larger, than the input sizes, but it is ok if the
  # number of padded edges are equal to the number of input edges.
  graphs_tuple_sizes = get_graphs_tuple_size(graphs_tuple)

  all_fields_fit = [
      tf.less_equal(graphs_tuple_sizes.num_edges,
                    graphs_tuple_padded_sizes.num_edges),
      tf.less(graphs_tuple_sizes.num_nodes,
              graphs_tuple_padded_sizes.num_nodes),
      tf.less(graphs_tuple_sizes.num_graphs,
              graphs_tuple_padded_sizes.num_graphs),
  ]
  all_fields_fit = functools.reduce(tf.math.logical_and, all_fields_fit)

  return tf.Assert(all_fields_fit, [
      "There is not enough space to pad the GraphsTuple "
      " with sizes (#nodes, #edges, #graphs):", graphs_tuple_sizes,
      " to padded sizes of :", graphs_tuple_padded_sizes,
      "`pad_edges_to` must be larger or equal to the maximum number of edges "
      "in any `GraphsTuple` and `pad_nodes_to`/`pad_graphs_to` must be "
      "strictly larger than the maximum number of nodes/graphs in any "
      "`GraphsTuple`."
  ])
Checks if a given graph can fit in the provided padded shape.

  Args:
    graphs_tuple: A `graphs.GraphsTuple` that is checked for size.
    graphs_tuple_padded_sizes: A `GraphsTupleSize` with the sized to pad to.

  Returns:
    An assertion op indicating whether there is space for the padding graph.
  
graph_nets/utils_tf.py