MCPcopy Create free account
hub / github.com/TencentARC/InstantMesh / count_params

Function count_params

src/utils/train_util.py:4–8  ·  view source on GitHub ↗
(model, verbose=False)

Source from the content-addressed store, hash-verified

2
3
4def count_params(model, verbose=False):
5 total_params = sum(p.numel() for p in model.parameters())
6 if verbose:
7 print(f"{model.__class__.__name__} has {total_params*1.e-6:.2f} M params.")
8 return total_params
9
10
11def instantiate_from_config(config):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected