MCPcopy
hub / github.com/zai-org/CogVideo / count_params

Function count_params

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

Source from the content-addressed store, hash-verified

245
246
247def count_params(model, verbose=False):
248 total_params = sum(p.numel() for p in model.parameters())
249 if verbose:
250 print(f"{model.__class__.__name__} has {total_params * 1.e-6:.2f} M params.")
251 return total_params
252
253
254def instantiate_from_config(config, **extra_kwargs):

Callers 1

__init__Method · 0.50

Calls 1

parametersMethod · 0.80

Tested by

no test coverage detected