class_docstr: Standalone Multiply-and-accumulate metric. Provides a lower bound of the
  computational cost of a model in a hardware-independent way by
  computing the number of multiplications. Currently supports only
  Linear or Conv2d modules. Other operations are ignored.
docstr: Computes the MAC metric.
  
  :param model: current model.
  :param dummy_input: A tensor of the correct size to feed as input
      to model. It includes batch size
  :return: MAC metric.
docstr_tok: ["Computes","the","MAC","metric",".",":","param","model",":","current","model",".",":","param","dummy_input",":","A","tensor","of","the","correct","size","to","feed","as","input","to","model",".","It","includes","batch","size",":","return",":","MAC","metric","."]
code: def update(self, model: Module, dummy_input: Tensor):
      """
      Computes the MAC metric.
  
      :param model: current model.
      :param dummy_input: A tensor of the correct size to feed as input
          to model. It includes batch size
      :return: MAC metric.
      """
  
      for mod in model.modules():
          if MAC.is_recognized_module(mod):
  
              def foo(a, b, c):
                  return self.update_compute_cost(a, b, c)
  
              handle = mod.register_forward_hook(foo)
              self.hooks.append(handle)
  
      self._compute_cost = 0
      model(dummy_input)  # trigger forward hooks
  
      for handle in self.hooks:
          handle.remove()
      self.hooks = []
  
imports: from torch.nn import Module
  from typing import List, Optional
  from torch import Tensor
  from avalanche.evaluation import Metric, PluginMetric, GenericPluginMetric
label_desc: Use image node_id 2 for calling the MAC obj's underlying member method code with example usage: obj.update(model, dummy_input) and returns: self