MCPcopy Create free account
hub / github.com/Vchitect/SEINE / count_params

Function count_params

models/utils.py:211–215  ·  view source on GitHub ↗
(model, verbose=False)

Source from the content-addressed store, hash-verified

209 model.total_ops += torch.DoubleTensor([matmul_ops])
210
211def count_params(model, verbose=False):
212 total_params = sum(p.numel() for p in model.parameters())
213 if verbose:
214 print(f"{model.__class__.__name__} has {total_params * 1.e-6:.2f} M params.")
215 return total_params

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected