def METHOD_NAME(self, obs: torch.Tensor, check_for_duplicates: bool = True):
    """
    Implements ranked probability score which is the sum of the qunatile
    losses for all possible quantiles.
    Here, the number of quantiles is finite and is equal to the number of
    unique values in (each batch element of) `obs`.
    Parameters
    ----------
    obs
    check_for_duplicates
    Returns
    -------
    """
    if self._validate_args:
        self._validate_sample(obs)
    probs_sorted, values_sorted = self.probs_sorted, self.values_sorted
    if (
        check_for_duplicates
        and torch.sum(torch.diff(values_sorted) == 0) > 0
    ):
        probs_sorted = self.adjust_probs(
            values_sorted=values_sorted, probs_sorted=probs_sorted
        )
    # Recompute CDF with adjusted probabilities.
    CDF = torch.cumsum(probs_sorted, dim=1)
    mask_non_zero_prob = (probs_sorted > 0).int()
    quantile_losses = mask_non_zero_prob * self.quantile_losses(
        obs,
        quantiles=values_sorted,
        levels=CDF,
    )
    # We return normalized RPS
    return torch.sum(quantile_losses, dim=-1) / torch.sum(
        mask_non_zero_prob, dim=-1
    )