def get_graphs_tuple_size(graphs_tuple):
  """Calculates the total nodes, edges and graphs in a graph batch.

  Args:
    graphs_tuple: A `GraphsTuple`.

  Returns:
    A `GraphsTupleSizes` object containing the total number of nodes, edges and
    graphs in the `GraphsTuple`. Each value is a scalar integer `tf.Tensor`.

  """
  num_nodes = tf.reduce_sum(graphs_tuple.n_node)
  num_edges = tf.reduce_sum(graphs_tuple.n_edge)
  num_graphs = tf.shape(graphs_tuple.n_node)[0]
  return GraphsTupleSize(num_nodes, num_edges, num_graphs)
Calculates the total nodes, edges and graphs in a graph batch.

  Args:
    graphs_tuple: A `GraphsTuple`.

  Returns:
    A `GraphsTupleSizes` object containing the total number of nodes, edges and
    graphs in the `GraphsTuple`. Each value is a scalar integer `tf.Tensor`.

  
graph_nets/utils_tf.py