    def forward(
        self, src_tokens: Tensor, src_lengths: Optional[Tensor] = None
    ) -> Dict[str, List[Tensor]]:
        """
        Args:
            src_tokens (LongTensor): tokens in the source language of shape
                `(batch, src_len)`

        Returns:
            dict:
                - **encoder_out** (Tensor): the last encoder layer's output of
                  shape `(src_len, batch, embed_dim)`
                - **encoder_padding_mask** (ByteTensor): the positions of
                  padding elements of shape `(batch, src_len)`
        """
        # embed tokens and positions
        x = self.embed_scale * self.embed_tokens(src_tokens)
        if self.embed_positions is not None:
            x += self.embed_positions(src_tokens)
        x = self.dropout_module(x)

        # B x T x C -> T x B x C
        x = x.transpose(0, 1)

        # compute padding mask
        encoder_padding_mask = src_tokens.eq(self.padding_idx)  # B x T
        if not encoder_padding_mask.any():
            encoder_mask = None
        else:
            encoder_mask = encoder_padding_mask

        # encoder layers
        for layer in self.layers:
            x = layer(x, encoder_mask)

        if self.layer_norm is not None:
            x = self.layer_norm(x)

        output_dict: Dict[str, List[Tensor]] = {}
        if src_lengths is not None:
            output_dict["src_lengths"] = [src_lengths]
        output_dict["encoder_out"] = [x]  # T x B x C
        if encoder_mask is not None:
            output_dict["encoder_padding_mask"] = [encoder_mask]  # B x T

        return output_dict
Args:
src_tokens (LongTensor): tokens in the source language of shape
`(batch, src_len)`

Returns:
dict:
- **encoder_out** (Tensor): the last encoder layer's output of
shape `(src_len, batch, embed_dim)`
- **encoder_padding_mask** (ByteTensor): the positions of
padding elements of shape `(batch, src_len)`
fairseq/models/lightconv.py