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 __init__(self, config, **kwargs):
      super().__init__(**kwargs)
      logging.info("Initialize RnnEncoder {}...".format(self.name))
  
      model_config = config["model"]["net"]["structure"]
      self.dropout_rate = model_config["dropout_rate"]
      self.cell_dim = model_config["cell_dim"]
      self.cell_type = model_config["cell_type"]
      if self.cell_type.lower() == "gru":
          rnn_class = tf.keras.layers.GRU
      elif self.cell_type.lower() == "lstm":
          rnn_class = tf.keras.layers.LSTM
      elif self.cell_type.lower() == "cudnngru":
          rnn_class = tf.keras.layers.CuDNNGRU
      elif self.cell_type.lower() == "cudnnlstm":
          rnn_class = tf.keras.layers.CuDNNLSTM
      else:
          error_info = (
              "Cell type: {} not supported now! Please check!".format(
                  self.cell_type
              )
          )
          logging.error(error_info)
          raise ValueError(error_info)
  
      self.sen_encoder = tf.keras.layers.Bidirectional(
          rnn_class(
              self.cell_dim, return_sequences=True, return_state=True
          )
      )
      logging.info("Initialize RnnEncoder {} Done.".format(self.name))
  
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 1 to create a new RnnEncoder object from inherited base classes: Layer with example: obj = RnnEncoder(config)