Files
tinygrad/examples
ShikChen 05e3202fba remove unused memsize_to_str and minor cleanups [pr] (#9211)
* fix edge cases in memsize_to_str()

Inputs <= 1 now return "0.00 B" for 0 and "1.00 B" for 1, avoiding an
IndexError. Also, memsize_to_str(1000) now returns "1.00 KB" instead of
"1000.00 B".

Replaced the list comprehension with a next(...) generator for conciseness
and efficiency.

* simplify code using idiomatic python

- Remove the unused `memsize_to_str()` function in helpers.
- Use a tuple for checking multiple string prefixes/suffixes.
- Avoid unnecessary list construction by using iterables directly.
- Check None in @diskcache to ensure proper caching of falsy values.

* revert generators back to list comprehension

Sometimes building list first could be faster. Keep it as is.
2025-02-23 09:58:37 -05:00
..
2025-02-20 18:03:09 -05:00
2025-02-20 18:03:09 -05:00
2023-03-11 16:28:10 -08:00
2025-02-20 18:03:09 -05:00
2025-02-20 18:03:09 -05:00
2024-09-24 10:08:04 +08:00
2024-11-12 22:11:40 -05:00
2024-07-03 09:06:01 -07:00
2024-07-02 21:39:01 -04:00
2024-12-04 21:46:37 -05:00
2024-07-03 22:47:10 -04:00
2024-09-25 17:45:13 +08:00
2024-05-22 20:43:21 -04:00
2024-11-14 17:56:02 +08:00
2023-11-28 17:36:55 -08:00
2024-12-26 12:45:19 -05:00
2023-12-08 12:59:38 -08:00
2024-12-03 15:10:41 +01:00