class_docstr: Base class for speaker models.
class_docstr_tok: ["Base","class","for","speaker","models","."]
docstr: LSTM layers. 
docstr_tok: ["LSTM","layers","."]
code: def lstm_layer(self, x):
      """LSTM layers."""
      if self.netconf["use_lstm_layer"]:
          with tf.variable_scope("lstm"):
              cell_fw = tf.nn.rnn_cell.BasicLSTMCell(
                  self.netconf["cell_num"], forget_bias=1.0
              )
              if self.netconf["use_dropout"]:
                  cell_fw = tf.nn.RNNCellDropoutWrapper(
                      cell=cell_fw,
                      output_keep_prob=1 - self.netconf["dropout_rate"]
                      if self.train
                      else 1.0,
                  )
  
              cell_bw = tf.nn.rnn_cell.BasicLSTMCell(
                  self.netconf["cell_num"], forget_bias=1.0
              )
              if self.netconf["use_dropout"]:
                  cell_bw = tf.nn.RNNCellDropoutWrapper(
                      cell=cell_bw,
                      output_keep_prob=1 - self.netconf["dropout_rate"]
                      if self.train
                      else 1.0,
                  )
  
              # Now we feed `linear` into the LSTM BRNN cell and obtain the LSTM BRNN output.
              outputs, _ = tf.nn.bidirectional_dynamic_rnn(
                  cell_fw=cell_fw,
                  cell_bw=cell_bw,
                  inputs=x,
                  dtype=tf.float32,
                  time_major=False,
                  scope="LSTM1",
              )
      else:
          outputs = x
      return outputs
  
imports: import math
  from absl import logging
  import delta.compat
  import tensorflow.keras.layers
  from delta import utils
  from delta.layers import common_layers
  from delta.models.base_model import RawModel
  from delta.utils.register import registers
  from delta.utils.loss.loss_utils import arcface_loss
  from delta.utils.hparam import HParams
label_desc: Use image node_id 6 for calling the SpeakerBaseRawModel obj's underlying member method code with example usage: obj.lstm_layer(x) and returns: outputs