def forward_jit_test(
        self, input: Tensor, lengths: Tensor, state: Optional[List[Tensor]] = None
    ) -> Tuple[Tensor, Tensor, List[Tensor]]:
        """
        This one simulate sequence encoder forward jit. This is for unit test purpose.
        It is not used in training or decoding. Note, extra_right_context is set in
        the model. In unit test, input = [utterance, right_context], lengths =
        [utterance_length].
        args:
            input: input utterance
            lengths: utterance input length
            state: None here. input is whole utterance
        """
        # [TODO] sequence_to_segment has bug in lengths.
        seg_src_tokens_lengths = self._gen_segs_right_context(input, lengths)

        seg_enc_tokens_lengths: List[Tuple[Tensor, Tensor]] = []
        state: Optional[List[Tensor]] = None
        for seg_src_tokens, seg_src_lengths in seg_src_tokens_lengths:
            seg_enc_tokens, seg_enc_lengths, state = self.forward_jit(
                input=seg_src_tokens, lengths=seg_src_lengths, state=state
            )
            seg_enc_tokens_lengths.append((seg_enc_tokens, seg_enc_lengths))

        enc_tokens, enc_lengths = segments_to_sequence(
            segments=seg_enc_tokens_lengths, time_axis=0
        )

        state = []  # returns trivial state

        return enc_tokens, enc_lengths, state

        This one simulate sequence encoder forward jit. This is for unit test purpose.
        It is not used in training or decoding. Note, extra_right_context is set in
        the model. In unit test, input = [utterance, right_context], lengths =
        [utterance_length].
        args:
            input: input utterance
            lengths: utterance input length
            state: None here. input is whole utterance
        
structured_prompting/fairseq-version/fairseq/fairseq/models/speech_to_text/modules/emformer.py