title: How to use tensorflow Attention layer?
body: <p>I am trying to understand how to use the <code>tf.keras.layers.Attention</code> shown here:</p>
  <p><a href="https://www.tensorflow.org/api_docs/python/tf/keras/layers/Attention" rel="nofollow noreferrer">Tensorflow Attention Layer</a></p>
  <p>I am trying to use it with encoder decoder seq2seq model. Below is my code:</p>
  <pre><code>encoder_inputs = Input(shape=(max_len_text,)) 
  enc_emb = Embedding(x_voc_size, latent_dim,trainable=True)(encoder_inputs) 
  encoder_lstm=LSTM(latent_dim, return_state=True, return_sequences=True) 
  encoder_outputs, state_h, state_c= encoder_lstm(enc_emb) 
  
  decoder_inputs = Input(shape=(max_len_summary,)) 
  dec_emb_layer = Embedding(y_voc_size, latent_dim,trainable=True) 
  dec_emb = dec_emb_layer(decoder_inputs) 
  
  decoder_lstm = LSTM(latent_dim, return_sequences=True, return_state=True) 
  decoder_outputs,decoder_fwd_state, decoder_back_state = decoder_lstm(dec_emb,initial_state=[state_h, state_c]) 
  </code></pre>
  <p>My question is, how to use the given Attention layer in keras with this model? I am not able to understand their document.</p>