(model, verbose=False)
| 209 | model.total_ops += torch.DoubleTensor([matmul_ops]) |
| 210 | |
| 211 | def count_params(model, verbose=False): |
| 212 | total_params = sum(p.numel() for p in model.parameters()) |
| 213 | if verbose: |
| 214 | print(f"{model.__class__.__name__} has {total_params * 1.e-6:.2f} M params.") |
| 215 | return total_params |
nothing calls this directly
no outgoing calls
no test coverage detected