MCPcopy Index your code
hub / github.com/VisionXLab/OF-Diff / count_params

Function count_params

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

Source from the content-addressed store, hash-verified

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

Callers 2

__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected