def METHOD_NAME(self, x, x_lengths, g=None):
    """
    Forward pass of the Decoder.
    Args:
        x (Tensor): Input tensor (B, 2 + attention_dim, T).
        x_lengths (Tensor): Length tensor (B,).
        g (Tensor, optional): Global conditioning tensor (B, global_channels, 1).
    Returns:
        Tensor: Output tensor (B, 1, T).
        Tensor: Output mask (B, 1, T).
    """
    x_mask = (
        make_non_pad_mask(x_lengths)
        .to(
            device=x.device,
            dtype=x.dtype,
        )
        .unsqueeze(1)
    )
    x = self.prenet(x) * x_mask
    if g is not None:
        x = x + self.global_conv(g)
    x = x.transpose(1, 2)
    x, _ = self.decoder(x, x_mask)
    x = x.transpose(1, 2)
    x = self.proj(x) * x_mask
    return x, x_mask