import torch


def expected_log_dirichlet(concentration: torch.Tensor) -> torch.Tensor:
    """Calculate the expected log of a Dirichlet distribution
    """
    return torch.digamma(input=concentration) - torch.digamma(input=torch.sum(input=concentration, dim=-1, keepdim=True))