def METHOD_NAME(
    labels: torch.Tensor,
    predictions: torch.Tensor,
    weights: Optional[torch.Tensor],
    threshold: float = 0.5,
) -> Dict[str, torch.Tensor]:
    if weights is None:
        weights = torch.ones_like(predictions)
    return {
        "accuracy_sum": compute_accuracy_sum(labels, predictions, weights, threshold),
        "weighted_num_samples": torch.sum(weights, dim=-1),
    }