(label: str, value: Any)
| 69 | |
| 70 | |
| 71 | def format_with_label(label: str, value: Any) -> str: |
| 72 | if isinstance(value, bool): |
| 73 | formatted = "T" if value else "F" |
| 74 | elif isinstance(value, (list, tuple)) and all(isinstance(v, bool) for v in value): |
| 75 | formatted = "".join("T" if b else "F" for b in value) |
| 76 | elif isinstance(value, torch.dtype): |
| 77 | formatted = describe_dtype(value) |
| 78 | else: |
| 79 | formatted = str(value) |
| 80 | return f"{label}={formatted}" |
| 81 | |
| 82 | |
| 83 | def id_formatter(label: str): |
no test coverage detected