def test_rate_metrics(
    binclf_curves: torch.Tensor,
    expected_fprs: torch.Tensor,
    expected_tprs: torch.Tensor,
) -> None:
    """Test if rate metrics are computed correctly."""
    tprs = per_image_tpr(binclf_curves)
    fprs = per_image_fpr(binclf_curves)

    assert tprs.shape == expected_tprs.shape
    assert fprs.shape == expected_fprs.shape

    assert torch.allclose(tprs, expected_tprs, equal_nan=True)
    assert torch.allclose(fprs, expected_fprs, equal_nan=True)
Test if rate metrics are computed correctly.
tests/unit/metrics/pimo/test_binary_classification_curve.py