class_docstr: A Highway LSTM network, as used in the original Tensorflow version of the Dozat parser. Note that this
  is independent from the HLSTMCell above.
class_docstr_tok: ["A","Highway","LSTM","network",",","as","used","in","the","original","Tensorflow","version","of","the","Dozat","parser",".","Note","that","this","is","independent","from","the","HLSTMCell","above","."]
code: def __init__(
      self,
      input_size,
      hidden_size,
      num_layers=1,
      bias=True,
      batch_first=False,
      dropout=0,
      bidirectional=False,
      rec_dropout=0,
      highway_func=None,
      pad=False,
  ):
      super(HighwayLSTM, self).__init__()
      self.input_size = input_size
      self.hidden_size = hidden_size
      self.num_layers = num_layers
      self.bias = bias
      self.batch_first = batch_first
      self.dropout = dropout
      self.dropout_state = {}
      self.bidirectional = bidirectional
      self.num_directions = 2 if bidirectional else 1
      self.highway_func = highway_func
      self.pad = pad
  
      self.lstm = nn.ModuleList()
      self.highway = nn.ModuleList()
      self.gate = nn.ModuleList()
      self.drop = nn.Dropout(dropout, inplace=True)
  
      in_size = input_size
      for l in range(num_layers):
          self.lstm.append(
              PackedLSTM(
                  in_size,
                  hidden_size,
                  num_layers=1,
                  bias=bias,
                  batch_first=batch_first,
                  dropout=0,
                  bidirectional=bidirectional,
                  rec_dropout=rec_dropout,
              )
          )
          self.highway.append(
              nn.Linear(in_size, hidden_size * self.num_directions)
          )
          self.gate.append(
              nn.Linear(in_size, hidden_size * self.num_directions)
          )
          self.highway[-1].bias.data.zero_()
          self.gate[-1].bias.data.zero_()
          in_size = hidden_size * self.num_directions
  
file_path: stanza/stanza/models/common/hlstm.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence, pack_sequence, PackedSequence
  from stanza.models.common.packed_lstm import PackedLSTM
label_desc: Use image node_id 1 to create a new HighwayLSTM object from inherited base classes: nn with example: obj = HighwayLSTM(input_size, hidden_size, num_layers, bias, batch_first, dropout, bidirectional, rec_dropout, highway_func, pad)