docstr: Prepare LSTM and parameters
  
  input_size: dimension of the inputs to the LSTM
  hidden_size: LSTM internal & output dimension
  num_lstm_layers: how many layers of LSTM to use
  dropout: value of the LSTM dropout
  uses_boundary_vector: if set, learn a start_embedding parameter.  otherwise, use zeros
  input_dropout: an nn.Module to dropout inputs.  TODO: allow a float parameter as well
code: def __init__(
      self,
      input_size,
      hidden_size,
      num_lstm_layers,
      dropout,
      uses_boundary_vector,
      input_dropout,
  ):
      """
      Prepare LSTM and parameters
  
      input_size: dimension of the inputs to the LSTM
      hidden_size: LSTM internal & output dimension
      num_lstm_layers: how many layers of LSTM to use
      dropout: value of the LSTM dropout
      uses_boundary_vector: if set, learn a start_embedding parameter.  otherwise, use zeros
      input_dropout: an nn.Module to dropout inputs.  TODO: allow a float parameter as well
      """
      super().__init__()
  
      self.uses_boundary_vector = uses_boundary_vector
  
      # The start embedding needs to be input_size as we put it through the LSTM
      if uses_boundary_vector:
          self.register_parameter(
              "start_embedding",
              torch.nn.Parameter(
                  0.2 * torch.randn(input_size, requires_grad=True)
              ),
          )
      else:
          self.register_buffer(
              "input_zeros", torch.zeros(num_lstm_layers, 1, input_size)
          )
          self.register_buffer(
              "hidden_zeros",
              torch.zeros(num_lstm_layers, 1, hidden_size),
          )
  
      self.lstm = nn.LSTM(
          input_size=input_size,
          hidden_size=hidden_size,
          num_layers=num_lstm_layers,
          dropout=dropout,
      )
      self.input_dropout = input_dropout
  
file_path: stanza/stanza/models/constituency/lstm_tree_stack.py
imports: from collections import namedtuple
  import torch
  import torch.nn
  from stanza.models.constituency.tree_stack import TreeStack
label_desc: Use image node_id 1 to create a new LSTMTreeStack object from inherited base classes: nn with example: obj = LSTMTreeStack(input_size, hidden_size, num_lstm_layers, dropout, uses_boundary_vector, input_dropout)