import torch


def binary_accuracy_from_logits(outputs: torch.Tensor, labels: torch.Tensor) -> float:
    """
    Function to compute binary classification accuracy based on model output (in logits) and ground truth labels

    :param outputs: Tensor of model output in logits
    :param labels: Tensor of ground truth labels
    :return: Fraction of correct predictions
    """
    outputs = (torch.sigmoid(outputs) > 0.5).float()
    correct = (outputs == labels).sum().item()
    return correct / labels.shape[0]