class_docstr: Global block.
  
  A block that updates the global features of each graph in a batch based on
  (a subset of) the previous global features, the aggregated features of the
  edges of the graph, and the aggregated features of the nodes of the graph.
  
  See https://arxiv.org/abs/1806.01261 for more details.
class_docstr_tok: ["Global","block",".","A","block","that","updates","the","global","features","of","each","graph","in","a","batch","based","on","(","a","subset","of",")","the","previous","global","features",",","the","aggregated","features","of","the","edges","of","the","graph",",","and","the","aggregated","features","of","the","nodes","of","the","graph",".","See","https",":","\/\/arxiv.org\/abs\/1806.01261","for","more","details","."]
docstr: 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.
docstr_tok: ["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","."]
code: 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)
  
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 GlobalBlock obj's underlying member method code with example usage: obj._build(graph, global_model_kwargs) and returns: graph