EncoderRNN

class EncoderRNN(word_dim, hidden_size, rnn_layers=6, dropout=0.2)[source]

EncoderRNN model to be used in the encoder of the RST Parser network.

forward(input_embeddings: transformers.tokenization_utils_base.BatchEncoding, input_lengths: List[int])Tuple[torch.Tensor, torch.Tensor][source]

Forward pass for encoder RNN.

Parameters
  • input_embeddings (BatchEncoding) – input embeddings from the RST preprocessor.

  • input_lengths (List[int]) – list of input lengths.

Returns

return outputs and hidden states of encoder.

Return type

Tuple[torch.Tensor, torch.Tensor]