def test_binned_aupro(labels: torch.Tensor, preds: torch.Tensor, threshold_count: int) -> None:
    """Test if the binned aupro is the same as the non-binned aupro."""
    aupro = AUPRO()
    computed_not_binned_aupro = aupro(preds, labels)

    binned_pro = AUPRO(num_thresholds=threshold_count)
    computed_binned_aupro = binned_pro(preds, labels)

    tolerance = 0.001
    # with threshold binning the roc curve computed within the metric is more memory efficient
    # but a bit less accurate. So we check the difference in order to validate the binning effect.
    assert computed_binned_aupro != computed_not_binned_aupro
    assert torch.allclose(computed_not_binned_aupro, computed_binned_aupro, atol=tolerance)

    # test with prediction higher than 1
    preds = preds * 2
    computed_binned_aupro = binned_pro(preds, labels)
    computed_not_binned_aupro = aupro(preds, labels)

    # with threshold binning the roc curve computed within the metric is more memory efficient
    # but a bit less accurate. So we check the difference in order to validate the binning effect.
    assert computed_binned_aupro != computed_not_binned_aupro
    assert torch.allclose(computed_not_binned_aupro, computed_binned_aupro, atol=tolerance)
Test if the binned aupro is the same as the non-binned aupro.
tests/unit/metrics/aupro/test_aupro.py