def METHOD_NAME(self, x, x_mask, g=None, reverse=False):
    """
    Shapes:
        - x:  :math:`[B, C, T]`
        - x_mask: :math:`[B, 1 ,T]`
        - g: :math:`[B, C]`
    """
    if not reverse:
        flows = self.flows
        logdet_tot = 0
    else:
        flows = reversed(self.flows)
        logdet_tot = None
    if self.num_squeeze > 1:
        x, x_mask = squeeze(x, x_mask, self.num_squeeze)
    for f in flows:
        if not reverse:
            x, logdet = f(x, x_mask, g=g, reverse=reverse)
            logdet_tot += logdet
        else:
            x, logdet = f(x, x_mask, g=g, reverse=reverse)
    if self.num_squeeze > 1:
        x, x_mask = unsqueeze(x, x_mask, self.num_squeeze)
    return x, logdet_tot