(self, x, h,
                     encoder_outputs=None,
                     input_valid_length=None)
return out, h
Single RNN Step
        1. Input Embedding (vocab_size => hidden_size)
        2. RNN Step (hidden_size => hidden_size)
        3. Output Projection (hidden_size => vocab size)

        Args:
            x: [batch_size]
            h: [num_layers, batch_size, hidden_size] (h and c from all layers)

        Return:
            out: [batch_size,vocab_size] (Unnormalized word distribution)
            h: [num_layers, batch_size, hidden_size] (h and c from all layers)
Single RNN Step
        1. Input Embedding (vocab_size => hidden_size)
        2. RNN Step (hidden_size => hidden_size)
        3. Output Projection (hidden_size => vocab size)
Single RNN Step 1 . Input Embedding ( vocab_size = > hidden_size ) 2 . RNN Step ( hidden_size = > hidden_size ) 3 . Output Projection ( hidden_size = > vocab size )
def forward_step(self, x, h,
                     encoder_outputs=None,
                     input_valid_length=None):
        """
        Single RNN Step
        1. Input Embedding (vocab_size => hidden_size)
        2. RNN Step (hidden_size => hidden_size)
        3. Output Projection (hidden_size => vocab size)

        Args:
            x: [batch_size]
            h: [num_layers, batch_size, hidden_size] (h and c from all layers)

        Return:
            out: [batch_size,vocab_size] (Unnormalized word distribution)
            h: [num_layers, batch_size, hidden_size] (h and c from all layers)
        """
        # x: [batch_size] => [batch_size, hidden_size]
        x = self.embed(x)

        # last_h: [batch_size, hidden_size] (h from Top RNN layer)
        # h: [num_layers, batch_size, hidden_size] (h and c from all layers)
        last_h, h = self.rnncell(x, h)

        if self.use_lstm:
            # last_h_c: [2, batch_size, hidden_size] (h from Top RNN layer)
            # h_c: [2, num_layers, batch_size, hidden_size] (h and c from all layers)
            last_h = last_h[0]

        # Unormalized word distribution
        # out: [batch_size, vocab_size]
        out = self.out(last_h)
        return out, h
def forward_step ( self , x , h , encoder_outputs = None , input_valid_length = None ) : # x: [batch_size] => [batch_size, hidden_size] x = self . embed ( x ) # last_h: [batch_size, hidden_size] (h from Top RNN layer) # h: [num_layers, batch_size, hidden_size] (h and c from all layers) last_h , h = self . rnncell ( x , h ) if self . use_lstm : # last_h_c: [2, batch_size, hidden_size] (h from Top RNN layer) # h_c: [2, num_layers, batch_size, hidden_size] (h and c from all layers) last_h = last_h [ 0 ] # Unormalized word distribution # out: [batch_size, vocab_size] out = self . out ( last_h ) return out , h