class_docstr: Test individual Metric classes.
class_docstr_tok: ["Test","individual","Metric","classes","."]
code: def test_sum_metric_additions(self):
      input_pairs_and_outputs = [
          (1, 2, 3),
          (3, -5.0, -2.0),
          (torch.Tensor([[[4.2]]]), 3, 7.2),
          (torch.DoubleTensor([1]), torch.LongTensor([[-1]]), 0),
      ]
      for input1, input2, output in input_pairs_and_outputs:
          actual_output = (
              SumMetric(input1) + SumMetric(input2)
          ).value()
          self.assertAlmostEqual(actual_output, output, places=6)
  
imports: import unittest
  from typing import Dict
  import torch
  import random
  from parlai.core.metrics import AverageMetric, SumMetric, FixedMetric, Metrics, GlobalAverageMetric, MacroAverageMetric, TimerMetric, aggregate_unnamed_reports, aggregate_named_reports, InterDistinctMetric, IntraDistinctMetric, FairseqBleuMetric
  from parlai.core.torch_classifier_agent import ConfusionMatrixMetric, WeightedF1Metric, AUCMetrics
  from parlai.core.torch_generator_agent import PPLMetric
  import parlai.utils.testing
label_desc: Use image node_id 2 for calling the TestMetric obj's underlying member method code with example usage: obj.test_sum_metric_additions() without return types