parameters: (encoder_inputs, decoder_inputs, cell,
                            num_encoder_symbols, num_decoder_symbols,
                            embedding_size, output_projection=None,
                            feed_previous=False, dtype=dtypes.float32,
                            scope=None)
docstring: Embedding RNN sequence-to-sequence model.
  
    This model first embeds encoder_inputs by a newly created embedding (of shape
    [num_encoder_symbols x input_size]). Then it runs an RNN to encode
    embedded encoder_inputs into a state vector. Next, it embeds decoder_inputs
    by another newly created embedding (of shape [num_decoder_symbols x
    input_size]). Then it runs RNN decoder, initialized with the last
    encoder state, on embedded decoder_inputs.
  
    Args:
      encoder_inputs: A list of 1D int32 Tensors of shape [batch_size].
      decoder_inputs: A list of 1D int32 Tensors of shape [batch_size].
      cell: rnn_cell.RNNCell defining the cell function and size.
      num_encoder_symbols: Integer; number of symbols on the encoder side.
      num_decoder_symbols: Integer; number of symbols on the decoder side.
      embedding_size: Integer, the length of the embedding vector for each symbol.
      output_projection: None or a pair (W, B) of output projection weights and
        biases; W has shape [output_size x num_decoder_symbols] and B has
        shape [num_decoder_symbols]; if provided and feed_previous=True, each
        fed previous output will first be multiplied by W and added B.
      feed_previous: Boolean or scalar Boolean Tensor; if True, only the first
        of decoder_inputs will be used (the "GO" symbol), and all other decoder
        inputs will be taken from previous outputs (as in embedding_rnn_decoder).
        If False, decoder_inputs are used as given (the standard decoder case).
      dtype: The dtype of the initial state for both the encoder and encoder
        rnn cells (default: tf.float32).
      scope: VariableScope for the created subgraph; defaults to
        "embedding_rnn_seq2seq"
  
    Returns:
      A tuple of the form (outputs, state), where:
        outputs: A list of the same length as decoder_inputs of 2D Tensors with
          shape [batch_size x num_decoder_symbols] containing the generated
          outputs.
        state: The state of each decoder cell in each time-step. This is a list
          with length len(decoder_inputs) -- one item for each time-step.
          It is a 2D Tensor of shape [batch_size x cell.state_size].
docstring_summary: Embedding RNN sequence-to-sequence model.
docstring_tokens: Embedding RNN sequence - to - sequence model .
function: def embedding_rnn_seq2seq(encoder_inputs, decoder_inputs, cell,
                            num_encoder_symbols, num_decoder_symbols,
                            embedding_size, output_projection=None,
                            feed_previous=False, dtype=dtypes.float32,
                            scope=None):
    """Embedding RNN sequence-to-sequence model.
  
    This model first embeds encoder_inputs by a newly created embedding (of shape
    [num_encoder_symbols x input_size]). Then it runs an RNN to encode
    embedded encoder_inputs into a state vector. Next, it embeds decoder_inputs
    by another newly created embedding (of shape [num_decoder_symbols x
    input_size]). Then it runs RNN decoder, initialized with the last
    encoder state, on embedded decoder_inputs.
  
    Args:
      encoder_inputs: A list of 1D int32 Tensors of shape [batch_size].
      decoder_inputs: A list of 1D int32 Tensors of shape [batch_size].
      cell: rnn_cell.RNNCell defining the cell function and size.
      num_encoder_symbols: Integer; number of symbols on the encoder side.
      num_decoder_symbols: Integer; number of symbols on the decoder side.
      embedding_size: Integer, the length of the embedding vector for each symbol.
      output_projection: None or a pair (W, B) of output projection weights and
        biases; W has shape [output_size x num_decoder_symbols] and B has
        shape [num_decoder_symbols]; if provided and feed_previous=True, each
        fed previous output will first be multiplied by W and added B.
      feed_previous: Boolean or scalar Boolean Tensor; if True, only the first
        of decoder_inputs will be used (the "GO" symbol), and all other decoder
        inputs will be taken from previous outputs (as in embedding_rnn_decoder).
        If False, decoder_inputs are used as given (the standard decoder case).
      dtype: The dtype of the initial state for both the encoder and encoder
        rnn cells (default: tf.float32).
      scope: VariableScope for the created subgraph; defaults to
        "embedding_rnn_seq2seq"
  
    Returns:
      A tuple of the form (outputs, state), where:
        outputs: A list of the same length as decoder_inputs of 2D Tensors with
          shape [batch_size x num_decoder_symbols] containing the generated
          outputs.
        state: The state of each decoder cell in each time-step. This is a list
          with length len(decoder_inputs) -- one item for each time-step.
          It is a 2D Tensor of shape [batch_size x cell.state_size].
    """
    with variable_scope.variable_scope(scope or "embedding_rnn_seq2seq"):
      # Encoder.
      encoder_cell = rnn_cell.EmbeddingWrapper(
          cell, embedding_classes=num_encoder_symbols,
          embedding_size=embedding_size)
      _, encoder_state = rnn.rnn(encoder_cell, encoder_inputs, dtype=dtype)
  
      # Decoder.
      if output_projection is None:
        cell = rnn_cell.OutputProjectionWrapper(cell, num_decoder_symbols)
  
      if isinstance(feed_previous, bool):
        return embedding_rnn_decoder(
            decoder_inputs, encoder_state, cell, num_decoder_symbols,
            embedding_size, output_projection=output_projection,
            feed_previous=feed_previous)
  
      # If feed_previous is a Tensor, we construct 2 graphs and use cond.
      def decoder(feed_previous_bool):
        reuse = None if feed_previous_bool else True
        with variable_scope.variable_scope(variable_scope.get_variable_scope(),
                                           reuse=reuse):
          outputs, state = embedding_rnn_decoder(
              decoder_inputs, encoder_state, cell, num_decoder_symbols,
              embedding_size, output_projection=output_projection,
              feed_previous=feed_previous_bool,
              update_embedding_for_previous=False)
          state_list = [state]
          if nest.is_sequence(state):
            state_list = nest.flatten(state)
          return outputs + state_list
  
      outputs_and_state = control_flow_ops.cond(feed_previous,
                                                lambda: decoder(True),
                                                lambda: decoder(False))
      outputs_len = len(decoder_inputs)  # Outputs length same as decoder inputs.
      state_list = outputs_and_state[outputs_len:]
      state = state_list[0]
      if nest.is_sequence(encoder_state):
        state = nest.pack_sequence_as(structure=encoder_state,
                                      flat_sequence=state_list)
      return outputs_and_state[:outputs_len], state
function_tokens: def embedding_rnn_seq2seq ( encoder_inputs , decoder_inputs , cell , num_encoder_symbols , num_decoder_symbols , embedding_size , output_projection = None , feed_previous = False , dtype = dtypes . float32 , scope = None ) : with variable_scope . variable_scope ( scope or "embedding_rnn_seq2seq" ) : # Encoder. encoder_cell = rnn_cell . EmbeddingWrapper ( cell , embedding_classes = num_encoder_symbols , embedding_size = embedding_size ) _ , encoder_state = rnn . rnn ( encoder_cell , encoder_inputs , dtype = dtype ) # Decoder. if output_projection is None : cell = rnn_cell . OutputProjectionWrapper ( cell , num_decoder_symbols ) if isinstance ( feed_previous , bool ) : return embedding_rnn_decoder ( decoder_inputs , encoder_state , cell , num_decoder_symbols , embedding_size , output_projection = output_projection , feed_previous = feed_previous ) # If feed_previous is a Tensor, we construct 2 graphs and use cond. def decoder ( feed_previous_bool ) : reuse = None if feed_previous_bool else True with variable_scope . variable_scope ( variable_scope . get_variable_scope ( ) , reuse = reuse ) : outputs , state = embedding_rnn_decoder ( decoder_inputs , encoder_state , cell , num_decoder_symbols , embedding_size , output_projection = output_projection , feed_previous = feed_previous_bool , update_embedding_for_previous = False ) state_list = [ state ] if nest . is_sequence ( state ) : state_list = nest . flatten ( state ) return outputs + state_list outputs_and_state = control_flow_ops . cond ( feed_previous , lambda : decoder ( True ) , lambda : decoder ( False ) ) outputs_len = len ( decoder_inputs ) # Outputs length same as decoder inputs. state_list = outputs_and_state [ outputs_len : ] state = state_list [ 0 ] if nest . is_sequence ( encoder_state ) : state = nest . pack_sequence_as ( structure = encoder_state , flat_sequence = state_list ) return outputs_and_state [ : outputs_len ] , state