def get_binary_statistics(
    outputs: Tensor, targets: Tensor, label: int = 1
) -> Tuple[Tensor, Tensor, Tensor, Tensor, Tensor]:
    """
    Computes the number of true negative, false positive,
    false negative, true positive and support
    for a binary classification problem for a given label.

    Args:
        outputs: estimated targets as predicted by a model
            with shape [bs; ..., 1]
        targets: ground truth (correct) target values
            with shape [bs; ..., 1]
        label: integer, that specifies label of interest for statistics compute

    Returns:
        Tuple[Tensor, Tensor, Tensor, Tensor, Tensor]: stats

    Example:

    .. code-block:: python

        import torch
        from catalyst import metrics
        y_pred = torch.tensor([[0, 0, 1, 1, 0, 1, 0, 1]])
        y_true = torch.tensor([[0, 1, 0, 1, 0, 0, 1, 1]])
        tn, fp, fn, tp, support = metrics.get_binary_statistics(y_pred, y_true)
        # tensor(2) tensor(2) tensor(2) tensor(2) tensor(4)

    """
    tn = ((outputs != label) * (targets != label)).to(torch.long).sum()
    fp = ((outputs == label) * (targets != label)).to(torch.long).sum()
    fn = ((outputs != label) * (targets == label)).to(torch.long).sum()
    tp = ((outputs == label) * (targets == label)).to(torch.long).sum()
    support = (targets == label).to(torch.long).sum()
    return tn, fp, fn, tp, support

    Computes the number of true negative, false positive,
    false negative, true positive and support
    for a binary classification problem for a given label.

    Args:
        outputs: estimated targets as predicted by a model
            with shape [bs; ..., 1]
        targets: ground truth (correct) target values
            with shape [bs; ..., 1]
        label: integer, that specifies label of interest for statistics compute

    Returns:
        Tuple[Tensor, Tensor, Tensor, Tensor, Tensor]: stats

    Example:

    .. code-block:: python

        import torch
        from catalyst import metrics
        y_pred = torch.tensor([[0, 0, 1, 1, 0, 1, 0, 1]])
        y_true = torch.tensor([[0, 1, 0, 1, 0, 0, 1, 1]])
        tn, fp, fn, tp, support = metrics.get_binary_statistics(y_pred, y_true)
        # tensor(2) tensor(2) tensor(2) tensor(2) tensor(4)

    
catalyst/metrics/functional/_misc.py