import torch


def evaluate_bs(confidences: torch.Tensor,
                true_labels: torch.Tensor) -> float:
    """
    Args:
        confidences (Tensor): a tensor of shape [N, K] of predicted confidences.
        true_labels (Tensor): a tensor of shape [N,] of ground truth labels.
    
    Returns:
        bs (float): average Brier score of predictions.
    """
    targets = torch.eye(
        confidences.size(1), device=confidences.device
    )[true_labels].long()

    bs = torch.sum(
        (confidences - targets)**2, dim=1
    ).mean().item()

    return bs