MCPcopy Create free account
hub / github.com/IceClear/StableSR / count_params

Function count_params

ldm/util.py:71–75  ·  view source on GitHub ↗
(model, verbose=False)

Source from the content-addressed store, hash-verified

69
70
71def count_params(model, verbose=False):
72 total_params = sum(p.numel() for p in model.parameters())
73 if verbose:
74 print(f"{model.__class__.__name__} has {total_params * 1.e-6:.2f} M params.")
75 return total_params
76
77
78def instantiate_from_config(config):

Callers 3

modules.pyFile · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected