class_docstr: vanilla stacked layer Seq2Seq model.
  
  Parameters
  ----------
  decoder_seq_length: int
      The length of your target sequence
  cell_enc : TensorFlow cell function
      The RNN function cell for your encoder stack, e.g tf.keras.layers.GRUCell
  cell_dec : TensorFlow cell function
      The RNN function cell for your decoder stack, e.g. tf.keras.layers.GRUCell
  n_layer : int
      The number of your RNN layers for both encoder and decoder block
  embedding_layer : tl.Layer
      A embedding layer, e.g. tl.layers.Embedding(vocabulary_size=voc_size, embedding_size=emb_dim)
  name : str
      The model name
  
  Examples
  ---------
  Classify stacked-layer Seq2Seq model, see `chatbot <https://github.com/tensorlayer/seq2seq-chatbot>`__
  
  Returns
  -------
      static stacked-layer Seq2Seq model.
class_docstr_tok: ["vanilla","stacked","layer","Seq2Seq","model",".","Parameters","--","--","--","--","--","decoder_seq_length",":","int","The","length","of","your","target","sequence","cell_enc",":","TensorFlow","cell","function","The","RNN","function","cell","for","your","encoder","stack",",","e.g","tf.keras.layers.GRUCell","cell_dec",":","TensorFlow","cell","function","The","RNN","function","cell","for","your","decoder","stack",",","e.g",".","tf.keras.layers.GRUCell","n_layer",":","int","The","number","of","your","RNN","layers","for","both","encoder","and","decoder","block","embedding_layer",":","tl.Layer","A","embedding","layer",",","e.g",".","tl.layers.Embedding","(","vocabulary_size=voc_size",",","embedding_size=emb_dim",")","name",":","str","The","model","name","Examples","--","--","--","--","-","Classify","stacked-layer","Seq2Seq","model",",","see","`","chatbot","<","https",":","\/\/github.com\/tensorlayer\/seq2seq-chatbot",">","`","__","Returns","--","--","--","-","static","stacked-layer","Seq2Seq","model","."]
code: def __init__(
      self,
      decoder_seq_length,
      cell_enc,
      cell_dec,
      n_units=256,
      n_layer=3,
      embedding_layer=None,
      name=None,
  ):
      super(Seq2seq, self).__init__(name=name)
      self.embedding_layer = embedding_layer
      self.vocabulary_size = embedding_layer.vocabulary_size
      self.embedding_size = embedding_layer.embedding_size
      self.n_layer = n_layer
      self.enc_layers = []
      self.dec_layers = []
      for i in range(n_layer):
          if i == 0:
              self.enc_layers.append(
                  tl.layers.RNN(
                      cell=cell_enc(units=n_units),
                      in_channels=self.embedding_size,
                      return_last_state=True,
                  )
              )
          else:
              self.enc_layers.append(
                  tl.layers.RNN(
                      cell=cell_enc(units=n_units),
                      in_channels=n_units,
                      return_last_state=True,
                  )
              )
  
      for i in range(n_layer):
          if i == 0:
              self.dec_layers.append(
                  tl.layers.RNN(
                      cell=cell_dec(units=n_units),
                      in_channels=self.embedding_size,
                      return_last_state=True,
                  )
              )
          else:
              self.dec_layers.append(
                  tl.layers.RNN(
                      cell=cell_dec(units=n_units),
                      in_channels=n_units,
                      return_last_state=True,
                  )
              )
  
      self.reshape_layer = tl.layers.Reshape([-1, n_units])
      self.dense_layer = tl.layers.Dense(
          n_units=self.vocabulary_size, in_channels=n_units
      )
      self.reshape_layer_after = tl.layers.Reshape(
          [-1, decoder_seq_length, self.vocabulary_size]
      )
      self.reshape_layer_individual_sequence = tl.layers.Reshape(
          [-1, 1, self.vocabulary_size]
      )
  
file_path: TensorLayer/tensorlayer/models/seq2seq.py
imports: import numpy
  import tensorflow
  import tensorlayer
  from tensorlayer.layers import Dense, Dropout, Input
  from tensorlayer.layers.core import Layer
  from tensorlayer.models import Model
label_desc: Use image node_id 1 to create a new Seq2seq object from inherited base classes: Model with example: obj = Seq2seq(decoder_seq_length, cell_enc, cell_dec, n_units, n_layer, embedding_layer, name)