def _build(self, graph, node_model_kwargs=None):
    """Connects the node block.

    Args:
      graph: A `graphs.GraphsTuple` containing `Tensor`s, whose individual edges
        features (if `use_received_edges` or `use_sent_edges` is `True`),
        individual nodes features (if `use_nodes` is True) and per graph globals
        (if `use_globals` is `True`) should be concatenable on the last axis.
      node_model_kwargs: Optional keyword arguments to pass to the `node_model`.

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

    nodes_to_collect = []

    if self._use_received_edges:
      nodes_to_collect.append(self._received_edges_aggregator(graph))

    if self._use_sent_edges:
      nodes_to_collect.append(self._sent_edges_aggregator(graph))

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

    if self._use_globals:
      # The hint will be an integer if the graph has node features and the total
      # number of nodes is known at tensorflow graph definition time, or None
      # otherwise.
      num_nodes_hint = _get_static_num_nodes(graph)
      nodes_to_collect.append(
          broadcast_globals_to_nodes(graph, num_nodes_hint=num_nodes_hint))

    collected_nodes = tf.concat(nodes_to_collect, axis=-1)
    updated_nodes = self._node_model(collected_nodes, **node_model_kwargs)
    return graph.replace(nodes=updated_nodes)
Connects the node block.

    Args:
      graph: A `graphs.GraphsTuple` containing `Tensor`s, whose individual edges
        features (if `use_received_edges` or `use_sent_edges` is `True`),
        individual nodes features (if `use_nodes` is True) and per graph globals
        (if `use_globals` is `True`) should be concatenable on the last axis.
      node_model_kwargs: Optional keyword arguments to pass to the `node_model`.

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