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

Class FlopCounter

k_diffusion/models/flops.py:20–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19
20class FlopCounter:
21 def __init__(self):
22 self.ops = []
23
24 def op(self, op, *args, **kwargs):
25 self.ops.append((op, args, kwargs))
26
27 @property
28 def flops(self):
29 flops = 0
30 for op, args, kwargs in self.ops:
31 flops += op(*args, **kwargs)
32 return flops
33
34
35def op(op, *args, **kwargs):

Callers 1

flop_counterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected