def _build(self, graph, global_model_kwargs=None):
    """Connects the global block.

    Args:
      graph: A `graphs.GraphsTuple` containing `Tensor`s, whose individual edges
        (if `use_edges` is `True`), individual nodes (if `use_nodes` is True)
        and per graph globals (if `use_globals` is `True`) should be
        concatenable on the last axis.
      global_model_kwargs: Optional keyword argumentsto pass to
        the `global_model`.

    Returns:
      An output `graphs.GraphsTuple` with updated globals.
    """
    if global_model_kwargs is None:
      global_model_kwargs = {}

    globals_to_collect = []

    if self._use_edges:
      _validate_graph(graph, (EDGES,), "when use_edges == True")
      globals_to_collect.append(self._edges_aggregator(graph))

    if self._use_nodes:
      _validate_graph(graph, (NODES,), "when use_nodes == True")
      globals_to_collect.append(self._nodes_aggregator(graph))

    if self._use_globals:
      _validate_graph(graph, (GLOBALS,), "when use_globals == True")
      globals_to_collect.append(graph.globals)

    collected_globals = tf.concat(globals_to_collect, axis=-1)
    updated_globals = self._global_model(
        collected_globals, **global_model_kwargs)
    return graph.replace(globals=updated_globals)
Connects the global block.

    Args:
      graph: A `graphs.GraphsTuple` containing `Tensor`s, whose individual edges
        (if `use_edges` is `True`), individual nodes (if `use_nodes` is True)
        and per graph globals (if `use_globals` is `True`) should be
        concatenable on the last axis.
      global_model_kwargs: Optional keyword argumentsto pass to
        the `global_model`.

    Returns:
      An output `graphs.GraphsTuple` with updated globals.
    
graph_nets/blocks.py