<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _build(self, inputs, prev_state, **kwargs):
 """Connects the DeepRNN module into the graph. If this is not the first time the module has been connected to the graph, the Tensors provided as input_ and state must have the same final dimension, in order for the existing variables to be the correct size for their corresponding multiplications. The batch size may differ for each connection. Args: inputs: a nested tuple of Tensors of arbitrary dimensionality, with at least an initial batch dimension. prev_state: a tuple of `prev_state`s that corresponds to the state of each one of the cores of the `DeepCore`. **kwargs: optional kwargs to be passed to the `_build` of all sub-modules. E.g. is_training=True. Note all sub-modules must accept the given kwarg. Returns: output: a nested tuple of Tensors of arbitrary dimensionality, with at least an initial batch dimension. next_state: a tuple of `next_state`s that corresponds to the updated state of each one of the cores of the `DeepCore`. Raises: ValueError: if connecting the module into the graph any time after the first time, and the inferred size of the inputs does not match previous invocations. This may happen if one connects a module any time after the first time that does not have the configuration of skip connections as the first time. """

    current_input = inputs
    next_states = []
    outputs = []
    recurrent_idx = 0
    concatenate = lambda *args: tf.concat(args, axis=-1)
    for i, core in enumerate(self._cores):
      if self._skip_connections and i > 0:
        current_input = nest.map_structure(concatenate, inputs, current_input)

      # Determine if this core in the stack is recurrent or not and call
      # accordingly.
      if self._is_recurrent_list[i]:
        current_input, next_state = core(current_input,
                                         prev_state[recurrent_idx],
                                         **kwargs)
        next_states.append(next_state)
        recurrent_idx += 1
      else:
        current_input = core(current_input, **kwargs)

      if self._skip_connections:
        outputs.append(current_input)

    if self._skip_connections and self._concat_final_output_if_skip:
      output = nest.map_structure(concatenate, *outputs)
    else:
      output = current_input

    self._last_output_size = _get_shape_without_batch_dimension(output)
    return output, tuple(next_states)