class_docstr: The Stack LSTM from Dyer et al: https://arxiv.org/abs/1505.08075
class_docstr_tok: ["The","Stack","LSTM","from","Dyer","et","al",":","https",":","\/\/arxiv.org\/abs\/1505.08075"]
docstr: Shapes:
      expression: (1, lstm_input_dim)
docstr_tok: ["Shapes",":","expression",":","(","1",",","lstm_input_dim",")"]
code: def push(self, expression: torch.Tensor, element: Element) -> None:
      """
      Shapes:
          expression: (1, lstm_input_dim)
      """
      old_top_state = self.stack[-1][0]
      # Unsqueezing expression for sequence_length = 1
      _, new_top_state = self.lstm(
          expression.unsqueeze(0), old_top_state
      )
      # Push in (state, (embedding, element))
      self.stack.append(
          (new_top_state, (self._lstm_output(new_top_state), element))
      )
  
imports: from typing import Any, List, Sized, Tuple
  import torch
  import torch.nn
  from pytext.torchscript.utils import reverse_tensor_list
  from pytext.utils.cuda import FloatTensor
  from pytext.utils.tensor import xaviervar
label_desc: Use image node_id 3 for calling the StackLSTM obj's underlying member method code with example usage: obj.push(expression, element) without return types