class_docstr: RNN + Attention
  Input Shape: [batch_size, steps, features]
  Output Shape: [batch_size, units]
class_docstr_tok: ["RNN","+","Attention","Input","Shape",":","[","batch_size",",","steps",",","features","]","Output","Shape",":","[","batch_size",",","units","]"]
code: def _build_attention(self, enc_outputs, enc_seq_len):
      with tf.variable_scope("AttentionMechanism"):
          if self.attn_Type == "bahdanau":
              attention_mechanism = seq2seq.BahdanauAttention(
                  num_units=2 * self.cell_dim,
                  memory=enc_outputs,
                  memory_sequence_length=enc_seq_len,
                  probability_fn=tf.nn.softmax,
                  normalize=True,
                  dtype=tf.get_variable_scope().dtype,
              )
          elif self.params["attention_type"] == "luong":
              attention_mechanism = seq2seq.LuongAttention(
                  num_units=2 * self.cell_dim,
                  memory=enc_outputs,
                  memory_sequence_length=enc_seq_len,
                  probability_fn=tf.nn.softmax,
                  dtype=tf.get_variable_scope().dtype,
              )
          else:
              raise ValueError("Unknown Attention Type")
          return attention_mechanism
  
imports: from absl import logging
  import delta.compat
  import delta
  from delta.layers.base_layer import Layer
  from tensorflow_addons import seq2seq
label_desc: Use image node_id 4 for calling the RnnDecoder obj's underlying member method code with example usage: obj._build_attention(enc_outputs, enc_seq_len) and returns: attention_mechanism