avalanche.evaluation.metrics.MAC
- class avalanche.evaluation.metrics.MAC[source]
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.
Methods
__init__
()Creates an instance of the MAC metric.
is_recognized_module
(mod)reset
()Resets the metric internal state.
result
()Return the number of MAC operations as computed in the previous call to the update method.
update
(model, dummy_input)Computes the MAC metric.
update_compute_cost
(module, dummy_input, output)