class_docstr: Test individual Metric classes.
class_docstr_tok: ["Test","individual","Metric","classes","."]
code: def test_average_metric_inputs(self):
      passing_inputs_and_outputs = [
          ((2, 4), 0.5),
          ((17.0, 10.0), 1.7),
          ((torch.Tensor([2.3]), torch.LongTensor([2])), 1.15),
          ((torch.Tensor([2.3]), torch.Tensor([2.0])), 1.15),
      ]
      for input_, output in passing_inputs_and_outputs:
          actual_output = AverageMetric(input_[0], input_[1]).value()
          self.assertAlmostEqual(actual_output, output, places=6)
          self.assertIsInstance(actual_output, float)
  
      failing_inputs = [
          ((2, "4"), AssertionError),
          ((torch.Tensor([1, 1]), torch.Tensor([2])), RuntimeError),
      ]
      for input_, error in failing_inputs:
          with self.assertRaises(error):
              AverageMetric(input_[0], input_[1])
  
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 3 for calling the TestMetric obj's underlying member method code with example usage: obj.test_average_metric_inputs() without return types