def forward_step(self, input_var, hidden, encoder_outputs, function):
    batch_size = input_var.size(0)
    output_size = input_var.size(1)
    embedded = self.embedding(input_var)
    embedded = self.input_dropout(embedded)
    (output, hidden) = self.rnn(embedded, hidden)
    attn = None
    if self.use_attention:
        (output, attn) = self.attention(output, encoder_outputs)
    predicted_softmax = function(self.out(output.view((- 1), self.hidden_size))).view(batch_size, output_size, (- 1))
    return (predicted_softmax, hidden, attn)
def forward_step(self, input_var, hidden, encoder_outputs, function):
    batch_size = input_var.size(0)
    output_size = input_var.size(1)
    embedded = self.embedding(input_var)
    embedded = self.input_dropout(embedded)
    (output, hidden) = self.rnn(embedded, hidden)
    attn = None
    if self.use_attention:
        (output, attn) = self.attention(output, encoder_outputs)
    predicted_softmax = function(self.out(output.view((- 1), self.hidden_size))).view(batch_size, output_size, (- 1))
    return (predicted_softmax, hidden, attn)