MCPcopy Create free account
hub / github.com/TencentARC/T2I-Adapter / count_params

Function count_params

configs/utils.py:69–73  ·  view source on GitHub ↗
(model, verbose=False)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected