spikingjelly.activation_based.op_counter package#
Quick Start#
Count one real execution with one or more counters:
from spikingjelly.activation_based import op_counter
counter = op_counter.FlopCounter()
with op_counter.DispatchCounterMode([counter]):
model(x)
print(counter.get_total())
Use the basic counters for runtime counts. Use an energy estimator when you need a specific cost model; the estimators are not interchangeable.
Use DispatchCounterMode for ATen rules, FunctionCounterMode for custom
torch.* rules, and ModuleCounterMode for module forward/backward rules.