(module)
| 29 | print_colored(*args, **kwargs) |
| 30 | |
| 31 | def param_count(module): |
| 32 | def count_parameters(model): |
| 33 | return sum(p.numel() for p in model.parameters() if p.requires_grad) |
| 34 | |
| 35 | total_params = count_parameters(module) |
| 36 | output = [f'Total model parameters: {total_params:,}', '---------------------------'] |
| 37 | |
| 38 | for name, child in module.named_children(): |
| 39 | params = count_parameters(child) |
| 40 | output.append(f'{name} parameters: {params:,}') |
| 41 | |
| 42 | return '\n'.join(output) |
| 43 | |
| 44 | def model_size_estimation(module): |
| 45 | def estimate_size(model): |
nothing calls this directly
no test coverage detected