import torch


def kl_forward(logu: torch.Tensor) -> torch.Tensor:
    """
    Log-space Csiszar function for forward KL-divergence D_f(p,q) = KL(p||q).

    Also known as the inclusive KL-divergence, minimizing results in
    zero-avoiding / mass-covering behavior.

    Args:
        logu (torch.Tensor): ``p.log_prob``s evaluated at samples from q.
    """
    return torch.exp(logu) * logu