class_docstr: Test aggregation metrics.
docstr: Test modular implementation.
docstr_tok: ["Test","modular","implementation","."]
code: def test_aggreagation(
      self, ddp, metric_class, compare_fn, values, weights
  ):
      """Test modular implementation."""
      self.run_class_metric_test(
          ddp=ddp,
          metric_class=metric_class,
          reference_metric=compare_fn,
          check_scriptable=True,
          # Abuse of names here
          preds=values,
          target=weights,
      )
  
imports: import numpy
  import pytest
  import torch
  from torchmetrics.aggregation import CatMetric, MaxMetric, MeanMetric, MinMetric, SumMetric
  from torchmetrics.collections import MetricCollection
  from unittests import BATCH_SIZE, NUM_BATCHES
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 1 for calling the TestAggregation obj's underlying member method code with example usage: obj.test_aggreagation(ddp, metric_class, compare_fn, values, weights) without return types