def METHOD_NAME(self, x: Tensor) -> Tensor:
    F = self.F
    n_trials = self.n_trials
    alpha = self.alpha
    sum_alpha = F.sum(alpha, axis=-1)
    ll = (
        F.gammaln(sum_alpha)
        + F.gammaln(F.ones_like(sum_alpha) * (n_trials + 1.0))
        - F.gammaln(sum_alpha + n_trials)
    )
    beta_matrix = (
        F.gammaln(x + alpha) - F.gammaln(x + 1) - F.gammaln(alpha)
    )
    ll = ll + F.sum(beta_matrix, axis=-1)
    return ll