MCPcopy Create free account
hub / github.com/Standard-Intelligence/hertz-dev / estimate_size

Function estimate_size

utils/interp.py:45–48  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

43
44def model_size_estimation(module):
45 def estimate_size(model):
46 param_size = sum(p.nelement() * p.element_size() for p in model.parameters())
47 buffer_size = sum(b.nelement() * b.element_size() for b in model.buffers())
48 return param_size + buffer_size
49
50 total_size = estimate_size(module)
51 output = [f'Total model size: {total_size / 1024**2:.2f} MB', '---------------------------']

Callers 1

model_size_estimationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected