class_docstr: Maintains state of the Parser. Useful for beam search
class_docstr_tok: ["Maintains","state","of","the","Parser",".","Useful","for","beam","search"]
code: def __init__(self, parser=None):
      if not parser:
          return
  
      self.buffer_stackrnn = StackLSTM(parser.buff_rnn)
      self.stack_stackrnn = StackLSTM(parser.stack_rnn)
      self.action_stackrnn = StackLSTM(parser.action_rnn)
  
      self.predicted_actions_idx = []
      self.action_scores = []
  
      self.num_open_NT = 0
      self.is_open_NT: List[bool] = []
      self.found_unsupported = False
      self.action_p = torch.Tensor()
  
      # negative cumulative log prob so sort(states) is in descending order
      self.neg_prob = 0
  
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 1 to create a new ParserState object  with example: obj = ParserState(parser)