class_docstr: Aggregates all nodes into globals.
class_docstr_tok: ["Aggregates","all","nodes","into","globals","."]
code: def _build(self, graph):
      _validate_graph(
          graph,
          (NODES,),
          additional_message="when aggregating from nodes.",
      )
      num_graphs = utils_tf.get_num_graphs(graph)
      graph_index = tf.range(num_graphs)
      indices = utils_tf.repeat(
          graph_index,
          graph.n_node,
          axis=0,
          sum_repeats_hint=_get_static_num_nodes(graph),
      )
      return self._reducer(graph.nodes, indices, num_graphs)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from graph_nets import _base
  from graph_nets import graphs
  from graph_nets import utils_tf
  import tensorflow
label_desc: Use image node_id 2 for calling the NodesToGlobalsAggregator obj's underlying member method code with example usage: obj._build(graph) and returns: self