def METHOD_NAME(
    self,
    x: torch.Tensor,
    pos_enc: torch.Tensor,
    mask: Optional[torch.Tensor] = None,
    chunk_mask: Optional[torch.Tensor] = None,
) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
    """Encode input sequences.
    Args:
        x: Conv1d input sequences. (B, T, D_in)
        pos_enc: Positional embedding sequences. (B, 2 * (T - 1), D_in)
        mask: Source mask. (B, T)
        chunk_mask: Chunk mask. (T_2, T_2)
    Returns:
        x: Conv1d output sequences. (B, sub(T), D_out)
        mask: Source mask. (B, T) or (B, sub(T))
        pos_enc: Positional embedding sequences.
                   (B, 2 * (T - 1), D_att) or (B, 2 * (sub(T) - 1), D_out)
    """
    x = x.transpose(1, 2)
    if self.lorder > 0:
        x = torch.nn.functional.pad(x, (self.lorder, 0), "constant", 0.0)
    else:
        mask = self.create_new_mask(mask)
        pos_enc = self.create_new_pos_enc(pos_enc)
    x = self.conv(x)
    if self.batch_norm:
        x = self.bn(x)
    x = self.dropout(x)
    if self.relu:
        x = self.relu_func(x)
    x = x.transpose(1, 2)
    return x, mask, self.out_pos(pos_enc)