class_docstr: Luong Attention-based Seq2Seq model. Implementation based on https://arxiv.org/pdf/1508.04025.pdf.
  
  Parameters
  ----------
  hidden_size: int
      The hidden size of both encoder and decoder RNN cells
  cell : TensorFlow cell function
      The RNN function cell for your encoder and decoder stack, e.g. tf.keras.layers.GRUCell
  embedding_layer : tl.Layer
      A embedding layer, e.g. tl.layers.Embedding(vocabulary_size=voc_size, embedding_size=emb_dim)
  method : str
      The three alternatives to calculate the attention scores, e.g. "dot", "general" and "concat"
  name : str
      The model name
  
  
  Returns
  -------
      static single layer attention-based Seq2Seq model.
code: def forward(self, inputs, seq_length=20, sos=None):
      src_seq = inputs[0]
      src_seq = self.embedding_layer(src_seq)
      (
          enc_output,
          encoding_hidden_states,
          last_hidden_states,
      ) = self.enc_layer(src_seq)
      encoding_hidden_states = tf.convert_to_tensor(
          encoding_hidden_states
      )
      encoding_hidden_states = tf.transpose(
          encoding_hidden_states, perm=[1, 0, 2]
      )
      last_hidden_states = tf.convert_to_tensor(last_hidden_states)
  
      if self.is_train:
          dec_seq = inputs[1]
          dec_seq = self.embedding_layer(dec_seq)
          dec_output = self.dec_layer(
              dec_seq,
              encoding_hidden_states,
              last_hidden_states,
              method=self.method,
          )
          batch_size = dec_output.shape[0]
          dec_output = tf.reshape(
              dec_output, [-1, dec_output.shape[-1]]
          )
          dec_output = self.dense_layer(dec_output)
          dec_output = tf.reshape(
              dec_output, [batch_size, -1, dec_output.shape[-1]]
          )
      else:
          dec_output = self.inference(
              src_seq,
              encoding_hidden_states,
              last_hidden_states,
              seq_length,
              sos,
          )
  
      return dec_output
  
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 3 for calling the Seq2seqLuongAttention obj's underlying member method code with example usage: obj.forward(inputs, seq_length, sos) and returns: dec_output