class_docstr: `BiLSTM` implements a multi-layer bidirectional LSTM representation layer
  preceded by a dropout layer.
  
  Args:
      config (Config): Configuration object of type BiLSTM.Config.
      embed_dim (int): The number of expected features in the input.
      padding_value (float): Value for the padded elements. Defaults to 0.0.
  
  Attributes:
      padding_value (float): Value for the padded elements.
      dropout (nn.Dropout): Dropout layer preceding the LSTM.
      lstm (nn.LSTM): LSTM layer that operates on the inputs.
      representation_dim (int): The calculated dimension of the output features
          of BiLSTM.
class_docstr_tok: ["`","BiLSTM","`","implements","a","multi-layer","bidirectional","LSTM","representation","layer","preceded","by","a","dropout","layer",".","Args",":","config","(","Config",")",":","Configuration","object","of","type","BiLSTM.Config",".","embed_dim","(","int",")",":","The","number","of","expected","features","in","the","input",".","padding_value","(","float",")",":","Value","for","the","padded","elements",".","Defaults","to","0.0",".","Attributes",":","padding_value","(","float",")",":","Value","for","the","padded","elements",".","dropout","(","nn.Dropout",")",":","Dropout","layer","preceding","the","LSTM",".","lstm","(","nn.LSTM",")",":","LSTM","layer","that","operates","on","the","inputs",".","representation_dim","(","int",")",":","The","calculated","dimension","of","the","output","features","of","BiLSTM","."]
code: def __init__(
      self, config: Config, embed_dim: int, padding_value: float = 0.0
  ) -> None:
      super().__init__(config)
  
      self.padding_value: float = padding_value
      self.dropout = nn.Dropout(config.dropout)
      self.lstm = nn.LSTM(
          embed_dim,
          config.lstm_dim,
          num_layers=config.num_layers,
          bidirectional=config.bidirectional,
          batch_first=True,
      )
      self.representation_dim: int = config.lstm_dim * (
          2 if config.bidirectional else 1
      )
      self.pack_sequence = config.pack_sequence
      self.disable_sort_in_jit = config.disable_sort_in_jit
      log_class_usage(__class__)
  
file_path: pytext/pytext/models/representations/bilstm.py
imports: from typing import Optional, Tuple
  import torch
  import torch.nn
  import torch.onnx
  from pytext.config import ConfigBase
  from pytext.utils import cuda
  from pytext.utils.usage import log_class_usage
  from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
  from .representation_base import RepresentationBase
label_desc: Use image node_id 1 to create a new BiLSTM object from inherited base classes: RepresentationBase with example: obj = BiLSTM(config, embed_dim, padding_value)