def _build(self,
             graph,
             edge_model_kwargs=None,
             global_model_kwargs=None):
    """Connects the RelationNetwork.

    Args:
      graph: A `graphs.GraphsTuple` containing `Tensor`s, except for the edges
        and global properties which may be `None`.
      edge_model_kwargs: Optional keyword arguments to pass to
        the edge block model.
      global_model_kwargs: Optional keyword arguments to pass to
        the global block model.

    Returns:
      A `graphs.GraphsTuple` with updated globals.

    Raises:
      ValueError: If any of `graph.nodes`, `graph.receivers` or `graph.senders`
        is `None`.
    """
    output_graph = self._global_block(
        self._edge_block(graph, edge_model_kwargs), global_model_kwargs)
    return graph.replace(globals=output_graph.globals)
Connects the RelationNetwork.

    Args:
      graph: A `graphs.GraphsTuple` containing `Tensor`s, except for the edges
        and global properties which may be `None`.
      edge_model_kwargs: Optional keyword arguments to pass to
        the edge block model.
      global_model_kwargs: Optional keyword arguments to pass to
        the global block model.

    Returns:
      A `graphs.GraphsTuple` with updated globals.

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