def _test_score(
    metric: AccumulativeMetric,
    batch: Dict[str, torch.Tensor],
    true_values: Dict[str, float],
) -> None:
    """Check if given metric works correctly"""
    metric.reset(num_batches=1, num_samples=len(batch["embeddings"]))
    metric.update(**batch)
    values = metric.compute_key_value()
    for key in true_values:
        assert key in values
        assert values[key] == true_values[key]
Check if given metric works correctly
tests/catalyst/metrics/test_cmc_score.py