def METHOD_NAME(
    self,
    x: torch.Tensor,
    x_len: torch.Tensor,
) -> Tuple[torch.Tensor, torch.Tensor]:
    """Encode input sequences.
    Args:
        x: Encoder input features. (B, T_in, F)
        x_len: Encoder input features lengths. (B,)
    Returns:
       x: Encoder outputs. (B, T_out, D_enc)
       x_len: Encoder outputs lenghts. (B,)
    """
    short_status, limit_size = check_short_utt(
        self.embed.subsampling_factor, x.size(1)
    )
    if short_status:
        raise TooShortUttError(
            f"has {x.size(1)} frames and is too short for subsampling "
            + f"(it needs more than {limit_size} frames), return empty results",
            x.size(1),
            limit_size,
        )
    mask = make_source_mask(x_len)
    x, mask = self.embed(x, mask)
    pos_enc = self.pos_enc(x)
    if self.dynamic_chunk_training:
        max_len = x.size(1)
        chunk_size = torch.randint(1, max_len, (1,)).item()
        if chunk_size > (max_len * self.short_chunk_threshold):
            chunk_size = max_len
        else:
            chunk_size = (chunk_size % self.short_chunk_size) + 1
        chunk_mask = make_chunk_mask(
            x.size(1),
            chunk_size,
            num_left_chunks=self.num_left_chunks,
            device=x.device,
        )
    else:
        chunk_mask = None
    x = self.encoders(
        x,
        pos_enc,
        mask,
        chunk_mask=chunk_mask,
    )
    return x, mask.eq(0).sum(1)