def METHOD_NAME(
    self,
    x: torch.Tensor,
    x_mask: Optional[torch.Tensor] = None,
    c: Optional[torch.Tensor] = None,
    g: Optional[torch.Tensor] = None,
) -> torch.Tensor:
    """Calculate forward propagation.
    Args:
        x (Tensor): Input noise signal (B, 1, T) if use_first_conv else
            (B, residual_channels, T).
        x_mask (Optional[Tensor]): Mask tensor (B, 1, T).
        c (Optional[Tensor]): Local conditioning features (B, aux_channels, T).
        g (Optional[Tensor]): Global conditioning features (B, global_channels, 1).
    Returns:
        Tensor: Output tensor (B, out_channels, T) if use_last_conv else
            (B, residual_channels, T).
    """
    # encode to hidden representation
    if self.use_first_conv:
        x = self.first_conv(x)
    # residual block
    skips = 0.0
    for f in self.conv_layers:
        x, h = f(x, x_mask=x_mask, c=c, g=g)
        skips = skips + h
    x = skips
    if self.scale_skip_connect:
        x = x * math.sqrt(1.0 / len(self.conv_layers))
    # apply final layers
    if self.use_last_conv:
        x = self.last_conv(x)
    return x