def _build(self, *args):
    """Connects the Sequential module into the graph.

    Args:
      *args: A tuple of inputs, to be unpacked as the arguments to the first
          layer.

    Returns:
      The output value of the last layer.
    """
    net = args

    if not self._layers:
      # If the sequential is passed a single arg, this will end up being
      # wrapped in an extra layer of tuple by *args. Normally we internally
      # handle this in the loop below, but if there are no layers we unpack here
      # in order to make Sequential([]) act like an identity, which seems right.
      if len(args) == 1:
        return args[0]
      else:
        return args

    for layer in self._layers:
      if isinstance(net, tuple):
        net = layer(*net)
      else:
        net = layer(net)

    return net