class_docstr: `BiLSTMSlotAttention` implements a multi-layer bidirectional LSTM based
  representation with attention over slots.
  
  Args:
      config (Config): Configuration object of type BiLSTMSlotAttention.Config.
      embed_dim (int): The number of expected features in the input.
  
  Attributes:
      dropout (nn.Dropout): Dropout layer preceding the LSTM.
      lstm (nn.Module): Module that implements the LSTM.
      attention (nn.Module): Module that implements the attention.
      dense (nn.Module): Module that implements the non-linear projection over
          attended representation.
      representation_dim (int): The calculated dimension of the output features
          of the `SlotAttention` representation.
class_docstr_tok: ["`","BiLSTMSlotAttention","`","implements","a","multi-layer","bidirectional","LSTM","based","representation","with","attention","over","slots",".","Args",":","config","(","Config",")",":","Configuration","object","of","type","BiLSTMSlotAttention.Config",".","embed_dim","(","int",")",":","The","number","of","expected","features","in","the","input",".","Attributes",":","dropout","(","nn.Dropout",")",":","Dropout","layer","preceding","the","LSTM",".","lstm","(","nn.Module",")",":","Module","that","implements","the","LSTM",".","attention","(","nn.Module",")",":","Module","that","implements","the","attention",".","dense","(","nn.Module",")",":","Module","that","implements","the","non-linear","projection","over","attended","representation",".","representation_dim","(","int",")",":","The","calculated","dimension","of","the","output","features","of","the","`","SlotAttention","`","representation","."]
code: def __init__(self, config: Config, embed_dim: int) -> None:
      super().__init__(config)
  
      self.dropout = nn.Dropout(config.dropout)
  
      # BiLSTM representation.
      self.lstm = create_module(config.lstm, embed_dim=embed_dim)
  
      # Slot attention.
      self.attention = None
      word_representation_dim = self.lstm.representation_dim
      if config.slot_attention:
          self.attention = SlotAttention(
              config.slot_attention,
              self.lstm.representation_dim,
              batch_first=True,
          )
          word_representation_dim += self.lstm.representation_dim
  
      # Projection over attended representation.
      self.dense = None
      self.representation_dim: int = self.lstm.representation_dim
      if config.mlp_decoder:
          self.dense = MLPDecoder(
              config.mlp_decoder, in_dim=self.lstm.representation_dim
          )
          self.representation_dim = self.dense.out_dim
      log_class_usage(__class__)
  
file_path: pytext/pytext/models/representations/bilstm_slot_attn.py
imports: from typing import Optional
  import torch
  import torch.nn
  from pytext.models.decoders.mlp_decoder import MLPDecoder
  from pytext.models.module import create_module
  from pytext.models.representations.bilstm import BiLSTM
  from pytext.utils.usage import log_class_usage
  from .representation_base import RepresentationBase
  from .slot_attention import SlotAttention
label_desc: Use image node_id 1 to create a new BiLSTMSlotAttention object from inherited base classes: RepresentationBase with example: obj = BiLSTMSlotAttention(config, embed_dim)