Formatting¶
Formatting utilities for sizes, parameter counts, bytes, and dtypes.
- taktiny.utils.format.parse_size(value)[source]¶
Parse a size expressed as a byte count or with a binary unit suffix.
- Parameters:
value (
int|str) – Integer byte count, or a string such as"64MB"usingKB,MB,GB, orTBsuffixes. Suffixes are case-insensitive and decimal magnitudes are accepted.- Return type:
- Returns:
The size expressed in bytes.
- Raises:
ValueError – If the value cannot be interpreted as a non-negative size.