Commit Graph

5 Commits

Author SHA1 Message Date
Sofie Van Landeghem
df9a644e24
make code bit more succinct 2025-11-22 22:48:55 +01:00
Pyry Takala
a33d04dca1 Cap stop parameter and warn once when it exceeds dataset size 2025-11-21 20:51:46 +00:00
Pyry Takala
85e49943ed Gracefully handle stop > dataset_size with warning 2025-11-21 20:04:33 +00:00
Pyry Takala
cd782a1977 Fix: Validate stop parameter against dataset size
Add validation in Task.__len__() to ensure stop parameter does not exceed
the actual dataset size. This prevents IndexError crashes during training
when invalid stop values are provided.

The validation is centralized in the base Task class and preserves the
original lazy evaluation behavior - num_examples() is only called when
needed (for validation when stop is provided, or for default value when
stop is None).

Fixes issue where training would crash with IndexError when iterating
over Task instances with stop > dataset_size.
2025-11-20 04:18:42 +00:00
karpathy
3a5e0bc50b initial commit 2025-10-13 06:49:24 -07:00