class_docstr: Test individual Metric classes.
class_docstr_tok: ["Test","individual","Metric","classes","."]
code: def test_average_metric_additions(self):
      input_pairs_and_outputs = [
          ((2, 4), (1.5, 1), 0.7),
          (
              (torch.LongTensor([[[2]]]), torch.Tensor([4])),
              (torch.FloatTensor([1.5]), 1),
              0.7,
          ),
      ]
      for input1, input2, output in input_pairs_and_outputs:
          actual_output = (
              AverageMetric(input1[0], input1[1])
              + AverageMetric(input2[0], input2[1])
          ).value()
          self.assertAlmostEqual(actual_output, output, places=6)
          self.assertIsInstance(actual_output, float)
  
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 4 for calling the TestMetric obj's underlying member method code with example usage: obj.test_average_metric_additions() without return types