def forward(self, inputs, state=None, **kwargs):
        """
        cell.forward : (input, state) -> (output, state)
        inputs : [n_batch, l_seq, d]
        """

        if self.transposed: inputs = inputs.transpose(-1, -2)

        # Automatically detect PackedSequence
        if isinstance(inputs, nn.utils.rnn.PackedSequence):
            return PackedRNN.forward(self, inputs)

        # Construct initial state
        state = self.cell.default_state(*inputs.shape[:-2], device=inputs.device)
        outputs = []

        for input in torch.unbind(inputs, dim=-2):
            output, new_state = self.step(input, state)
            state = new_state
            if self.return_output:
                outputs.append(output)
        outputs = torch.stack(outputs, dim=-2) if self.return_output else None
        if self.transposed and outputs is not None: outputs = outputs.transpose(-1, -2)
        return outputs, state

        cell.forward : (input, state) -> (output, state)
        inputs : [n_batch, l_seq, d]
        
analyze/convnexts4nd/src/models/sequence/rnns/rnn.py