MCPcopy
hub / github.com/Stability-AI/generative-models / count_params

Function count_params

sgm/util.py:161–165  ·  view source on GitHub ↗
(model, verbose=False)

Source from the content-addressed store, hash-verified

159
160
161def count_params(model, verbose=False):
162 total_params = sum(p.numel() for p in model.parameters())
163 if verbose:
164 print(f"{model.__class__.__name__} has {total_params * 1.e-6:.2f} M params.")
165 return total_params
166
167
168def instantiate_from_config(config):

Callers 3

test01Function · 0.90
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected