def _build(self,
             graph,
             edge_model_kwargs=None,
             node_encoder_model_kwargs=None,
             node_model_kwargs=None):
    """Connects the CommNet network.

    Args:
      graph: A `graphs.GraphsTuple` containing `Tensor`s, with non-`None` nodes,
        receivers and senders.
      edge_model_kwargs: Optional keyword arguments to pass to
        the edge block model.
      node_encoder_model_kwargs: Optional keyword arguments to pass to
        the node block ecoder model.
      node_model_kwargs: Optional keyword arguments to pass to
        the node block model.

    Returns:
      An output `graphs.GraphsTuple` with updated nodes.

    Raises:
      ValueError: if any of `graph.nodes`, `graph.receivers` or `graph.senders`
      is `None`.
    """
    node_input = self._node_encoder_block(
        self._edge_block(graph, edge_model_kwargs), node_encoder_model_kwargs)
    return graph.replace(
        nodes=self._node_block(node_input, node_model_kwargs).nodes)
Connects the CommNet network.

    Args:
      graph: A `graphs.GraphsTuple` containing `Tensor`s, with non-`None` nodes,
        receivers and senders.
      edge_model_kwargs: Optional keyword arguments to pass to
        the edge block model.
      node_encoder_model_kwargs: Optional keyword arguments to pass to
        the node block ecoder model.
      node_model_kwargs: Optional keyword arguments to pass to
        the node block model.

    Returns:
      An output `graphs.GraphsTuple` with updated nodes.

    Raises:
      ValueError: if any of `graph.nodes`, `graph.receivers` or `graph.senders`
      is `None`.
    
graph_nets/modules.py