MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / num_parameters

Function num_parameters

lit_gpt/utils_old.py:27–28  ·  view source on GitHub ↗
(module: nn.Module, requires_grad: Optional[bool] = None)

Source from the content-addressed store, hash-verified

25
26
27def num_parameters(module: nn.Module, requires_grad: Optional[bool] = None) -> int:
28 return sum(p.numel() for p in module.parameters() if requires_grad is None or p.requires_grad == requires_grad)
29
30
31@contextmanager

Callers 2

estimate_flopsFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected