class_docstr: `AugmentedLSTM` implements a generic AugmentedLSTM representation layer.
  AugmentedLSTM is an LSTM which optionally appends
  an optional highway network to the output layer.
  Furthermore the dropout controlls the level of variational dropout done.
  
  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.
      forward_layers (nn.ModuleList): A module list of unidirectional AugmentedLSTM
          layers moving forward in time.
      backward_layers (nn.ModuleList): A module list of unidirectional AugmentedLSTM
          layers moving backward in time.
      representation_dim (int): The calculated dimension of the output features
          of AugmentedLSTM.
class_docstr_tok: ["`","AugmentedLSTM","`","implements","a","generic","AugmentedLSTM","representation","layer",".","AugmentedLSTM","is","an","LSTM","which","optionally","appends","an","optional","highway","network","to","the","output","layer",".","Furthermore","the","dropout","controlls","the","level","of","variational","dropout","done",".","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",".","forward_layers","(","nn.ModuleList",")",":","A","module","list","of","unidirectional","AugmentedLSTM","layers","moving","forward","in","time",".","backward_layers","(","nn.ModuleList",")",":","A","module","list","of","unidirectional","AugmentedLSTM","layers","moving","backward","in","time",".","representation_dim","(","int",")",":","The","calculated","dimension","of","the","output","features","of","AugmentedLSTM","."]
docstr: Given an input batch of sequential data such as word embeddings, produces
  a AugmentedLSTM representation of the sequential input and new state
  tensors.
  
  Args:
      embedded_tokens (torch.Tensor): Input tensor of shape
          (bsize x seq_len x input_dim).
      seq_lengths (torch.Tensor): List of sequences lengths of each batch element.
      states (Tuple[torch.Tensor, torch.Tensor]): Tuple of tensors containing
          the initial hidden state and the cell state of each element in
          the batch. Each of these tensors have a dimension of
          (bsize x num_layers x num_directions * nhid). Defaults to `None`.
  
  Returns:
      Tuple[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]:
          AgumentedLSTM representation of input and
          the state of the LSTM `t = seq_len`.
          Shape of representation is (bsize x seq_len x representation_dim).
          Shape of each state is (bsize x num_layers * num_directions x nhid).
docstr_tok: ["Given","an","input","batch","of","sequential","data","such","as","word","embeddings",",","produces","a","AugmentedLSTM","representation","of","the","sequential","input","and","new","state","tensors",".","Args",":","embedded_tokens","(","torch.Tensor",")",":","Input","tensor","of","shape","(","bsize","x","seq_len","x","input_dim",")",".","seq_lengths","(","torch.Tensor",")",":","List","of","sequences","lengths","of","each","batch","element",".","states","(","Tuple","[","torch.Tensor",",","torch.Tensor","]",")",":","Tuple","of","tensors","containing","the","initial","hidden","state","and","the","cell","state","of","each","element","in","the","batch",".","Each","of","these","tensors","have","a","dimension","of","(","bsize","x","num_layers","x","num_directions","*","nhid",")",".","Defaults","to","`","None","`",".","Returns",":","Tuple","[","torch.Tensor",",","Tuple","[","torch.Tensor",",","torch.Tensor","]","]",":","AgumentedLSTM","representation","of","input","and","the","state","of","the","LSTM","`","t","=","seq_len","`",".","Shape","of","representation","is","(","bsize","x","seq_len","x","representation_dim",")",".","Shape","of","each","state","is","(","bsize","x","num_layers","*","num_directions","x","nhid",")","."]
code: def forward(
      self,
      embedded_tokens: torch.Tensor,
      seq_lengths: torch.Tensor,
      states: Optional[Tuple[torch.Tensor, torch.Tensor]] = None,
  ) -> Tuple[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]:
      """
      Given an input batch of sequential data such as word embeddings, produces
      a AugmentedLSTM representation of the sequential input and new state
      tensors.
  
      Args:
          embedded_tokens (torch.Tensor): Input tensor of shape
              (bsize x seq_len x input_dim).
          seq_lengths (torch.Tensor): List of sequences lengths of each batch element.
          states (Tuple[torch.Tensor, torch.Tensor]): Tuple of tensors containing
              the initial hidden state and the cell state of each element in
              the batch. Each of these tensors have a dimension of
              (bsize x num_layers x num_directions * nhid). Defaults to `None`.
  
      Returns:
          Tuple[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]:
              AgumentedLSTM representation of input and
              the state of the LSTM `t = seq_len`.
              Shape of representation is (bsize x seq_len x representation_dim).
              Shape of each state is (bsize x num_layers * num_directions x nhid).
  
      """
      rnn_input = pack_padded_sequence(
          embedded_tokens, seq_lengths.int(), batch_first=True
      )
      if states is not None:
          states = (
              states[0].transpose(0, 1),
              states[1].transpose(0, 1),
          )
      if self.bidirectional:
          return self._forward_bidirectional(rnn_input, states)
      return self._forward_unidirectional(rnn_input, states)
  
imports: import math
  from typing import Optional, Tuple
  import torch
  import torch.nn
  from pytext.config import ConfigBase
  from pytext.utils.usage import log_class_usage
  from torch.nn.utils.rnn import pack_padded_sequence, PackedSequence, pad_packed_sequence
  from .representation_base import RepresentationBase
label_desc: Use image node_id 2 for calling the AugmentedLSTM obj's underlying member method code with example usage: obj.forward(embedded_tokens, seq_lengths, states) and returns: self, self