class_docstr: Test individual Metric classes.
class_docstr_tok: ["Test","individual","Metric","classes","."]
code: def test_sum_metric_inputs(self):
      passing_inputs_and_outputs = [
          (2, 2.0),
          (-5.0, -5.0),
          (torch.LongTensor([[-1]]), -1.0),
          (torch.DoubleTensor([34.68]), 34.68),
      ]
      for input_, output in passing_inputs_and_outputs:
          actual_output = SumMetric(input_).value()
          self.assertEqual(actual_output, output)
  
      failing_inputs = [
          ("4", AssertionError),
          ([6.8], AssertionError),
          (
              torch.Tensor([1, 3.8]),
              RuntimeError,
          ),  # Tensor has more than 1 element
      ]
      for input_, error in failing_inputs:
          with self.assertRaises(error):
              SumMetric(input_)
  
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 1 for calling the TestMetric obj's underlying member method code with example usage: obj.test_sum_metric_inputs() without return types