MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / flop_counter

Function flop_counter

k_diffusion/models/flops.py:11–17  ·  view source on GitHub ↗
(enable=True)

Source from the content-addressed store, hash-verified

9
10@contextmanager
11def flop_counter(enable=True):
12 try:
13 old_flop_counter = state.flop_counter
14 state.flop_counter = FlopCounter() if enable else None
15 yield state.flop_counter
16 finally:
17 state.flop_counter = old_flop_counter
18
19
20class FlopCounter:

Callers

nothing calls this directly

Calls 1

FlopCounterClass · 0.85

Tested by

no test coverage detected