Format parameter count in terms of K (1000)
(num: int)
| 3 | from typing import Dict, Tuple |
| 4 | |
| 5 | def format_params(num: int) -> str: |
| 6 | """Format parameter count in terms of K (1000)""" |
| 7 | if num >= 1000: |
| 8 | return f"{num/1000:.2f}K" |
| 9 | return str(num) |
| 10 | |
| 11 | def count_parameters(model: nn.Module, verbose: bool = False) -> Dict[str, float]: |
| 12 | """ |