code: def test_amca_two_task_static(self):
      # Test AMCA by passing the classes parameter (non-dynamic)
      with self.assertRaises(Exception):
          metric = AverageMeanClassAccuracy(
              classes={0: (0, 1, 2, "aaa"), 1: (0, 1, 2)}
          )
  
      metric = AverageMeanClassAccuracy(
          classes={0: (0, 1, 2), 1: (0, 1, 2)}
      )
      self.assertDictEqual(metric.result(), {0: 0.0, 1: 0.0})
      metric.reset()
      self.assertDictEqual(metric.result(), {0: 0.0, 1: 0.0})
  
      metric.next_experience()
      self.assertDictEqual(metric.result(), {0: 0.0, 1: 0.0})
      metric.reset()
  
      my_y = torch.as_tensor([0, 0, 1, 0, 2, 2, 0])
      my_out = torch.as_tensor([0, 0, 1, 2, 1, 1, 1])
      my_amca = (0.5 + 1.0 + 0.0) / 3
      # 0: 50%, 1: 100%, 2: 0%
  
      my_y2 = torch.as_tensor([0, 0, 1, 0, 2, 2, 0])
      my_out2 = torch.as_tensor([2, 2, 2, 2, 1, 2, 1])
      my_amca2 = (0.0 + 0.0 + 0.5) / 3
      # 0: 0%, 1: 0%, 2: 50%
  
      my_amca_1_and_2 = (my_amca + my_amca2) / 2
  
      metric.update(my_out, my_y, 0)
      self.assertDictEqual(metric.result(), {0: my_amca, 1: 0.0})
  
      metric.reset()
      # After reset, previously dynamically added tasks are remembered
      self.assertDictEqual(metric.result(), {0: 0.0, 1: 0.0})
  
      metric.update(my_out, my_y, 0)
      self.assertDictEqual(metric.result(), {0: my_amca, 1: 0.0})
  
      metric.update(my_out2, my_y2, 1)
      self.assertDictEqual(metric.result(), {0: my_amca, 1: my_amca2})
      metric.next_experience()
      self.assertDictEqual(
          metric.result(), {0: my_amca / 2, 1: my_amca2 / 2}
      )
  
      many_ts = [0] * len(my_out)
      many_ts += [1] * len(my_out2)
      metric.update(
          torch.cat((my_out, my_out2)),
          torch.cat((my_y, my_y2)),
          torch.as_tensor(many_ts),
      )
  
      self.assertDictEqual(metric.result(), {0: my_amca, 1: my_amca2})
  
      metric.next_experience()
      self.assertDictEqual(
          metric.result(), {0: my_amca * 2 / 3, 1: my_amca2 * 2 / 3}
      )
  
      metric.reset()
      self.assertDictEqual(metric.result(), {0: 0.0, 1: 0.0})
  
imports: import unittest
  import torch
  from avalanche.evaluation.metrics import TaskAwareAccuracy, TopkAccuracy, AverageMeanClassAccuracy, MultiStreamAMCA, ClassAccuracy, TaskAwareLoss, ConfusionMatrix, DiskUsage, MAC, CPUUsage, MaxGPU, MaxRAM, Mean, Sum, ElapsedTime, Forgetting, ForwardTransfer, CumulativeAccuracy, LabelsRepartition
  from tests.unit_tests_utils import FAST_TEST, is_github_action
label_desc: Use image node_id 11 for calling the GeneralMetricTests obj's underlying member method code with example usage: obj.test_amca_two_task_static() without return types