def forward(self, inputs, begin_state): 
encoded = self.embedding(inputs)<EOL>length = inputs.shape[<NUM_LIT:0>]<EOL>batch_size = inputs.shape[<NUM_LIT:1>]<EOL>encoded, state = self.encoder.unroll(length, encoded, begin_state,<EOL>layout='<STR_LIT>', merge_outputs=True)<EOL>encoded = encoded.reshape((-<NUM_LIT:1>, self._projection_size))<EOL>out = self.decoder(encoded)<EOL>out = out.reshape((length, batch_size, -<NUM_LIT:1>))<EOL>return out, state<EOL>
Implement forward computation.

        Parameters
        -----------
        inputs : NDArray
            input tensor with shape `(sequence_length, batch_size)`
            when `layout` is "TNC".
        begin_state : list
            initial recurrent state tensor with length equals to num_layers*2.
            For each layer the two initial states have shape `(batch_size, num_hidden)`
            and `(batch_size, num_projection)`

        Returns
        --------
        out : NDArray
            output tensor with shape `(sequence_length, batch_size, vocab_size)`
              when `layout` is "TNC".
        out_states : list
            output recurrent state tensor with length equals to num_layers*2.
            For each layer the two initial states have shape `(batch_size, num_hidden)`
            and `(batch_size, num_projection)`