(model, verbose=False)
| 67 | |
| 68 | |
| 69 | def count_params(model, verbose=False): |
| 70 | total_params = sum(p.numel() for p in model.parameters()) |
| 71 | if verbose: |
| 72 | print(f"{model.__class__.__name__} has {total_params * 1.e-6:.2f} M params.") |
| 73 | return total_params |
| 74 | |
| 75 | |
| 76 | def instantiate_from_config(config): |
nothing calls this directly
no outgoing calls
no test coverage detected