code: def test_single_label(self) -> None:
      size = (4, 3, 2, 1)
      data = torch.randn((100,) + size)
  
      single_labels = [1, "apple"]
  
      for label in single_labels:
          summarizer = ClassSummarizer(stats=CommonStats())
          summarizer.update(data, label)
          summ1 = summarizer.summary
          summ2 = summarizer.class_summaries
          self.assertIsNotNone(summ1)
          self.assertIsNotNone(summ2)
  
          self.assertIsInstance(summ1, list)
          self.assertTrue(len(summ1) == 1)
  
          self.assertIsInstance(summ2, dict)
          self.assertTrue(label in summ2)
          self.assertTrue(len(summ1) == len(summ2[label]))
          for key in summ1[0].keys():
              self.assertTrue(
                  (summ1[0][key] == summ2[label][0][key]).all()
              )
  
file_path: captum/tests/attr/test_class_summarizer.py
imports: import torch
  from captum.attr import ClassSummarizer, CommonStats
  from tests.helpers.basic import BaseTest
label_desc: Use image node_id 4 for calling the Test obj's underlying member method code with example usage: obj.test_single_label() without return types