def test_accumulation_dtype():
    """Check if AccumulativeMetric accumulates all the data with correct types"""
    batch_size = 10
    batch = {
        "field_int": torch.randint(low=0, high=5, size=(batch_size, 5)),
        "field_bool": torch.randint(
            low=0, high=2, size=(batch_size, 10), dtype=torch.bool
        ),
        "field_float32": torch.rand(size=(batch_size, 4), dtype=torch.float32),
    }
    metric = AccumulativeMetric(keys=list(batch.keys()))
    metric.reset(num_samples=batch_size, num_batches=1)
    metric.update(**batch)
    for key in batch:
        assert (batch[key] == metric.storage[key]).all()
        assert batch[key].dtype == metric.storage[key].dtype
Check if AccumulativeMetric accumulates all the data with correct types
tests/catalyst/metrics/test_cmc_score.py