DecoderRNN

class DecoderRNN(input_size, hidden_size, rnn_layers=6, dropout=0.2)[source]

DecoderRNN model to be used in the decoder of the RST Parser network.

forward(input_hidden_states: torch.Tensor, last_hidden: torch.Tensor)Tuple[torch.Tensor, torch.Tensor][source]

Forward pass for decoder RNN.

Parameters
  • input_hidden_states (torch.Tensor) – input hidden tensor from encoder RNN output.

  • last_hidden (torch.Tensor) – last hidden state from encoder RNN.

Returns

return the output and final hidden state.

Return type

Tuple[torch.Tensor, torch.Tensor]