Orchestrates sampling and collation into batches – pulsatrix's DataLoader (PyTorch DataLoader / torch::data::DataLoader analogue).
More...
#include <data_loader.hpp>
Orchestrates sampling and collation into batches – pulsatrix's DataLoader (PyTorch DataLoader / torch::data::DataLoader analogue).
- Note
- Phase 1 ships a fully synchronous implementation (num_workers=0 is the only exercised path): DataThreadPool/BoundedQueue exist (see those headers) but are not yet wired into this class's fetch/collate path – wiring num_workers > 0 through a real staged pipeline is a dedicated, separately-tested later mission (Decision Point 7 in campaign_exai_dl_library_data_pipeline).
◆ DataLoader() [1/2]
Constructs a DataLoader over a random-access Dataset.
- Exceptions
-
| std::invalid_argument | if dataset is null or options.batch_size <= 0. |
◆ DataLoader() [2/2]
Constructs a DataLoader over a streaming IterableDataset.
- Exceptions
-
| std::invalid_argument | if dataset is null, options.batch_size <= 0, or options.num_workers > 1 – sharded multi-worker streaming is out of scope for this phase (a single worker can safely consume the whole stream). |
◆ next_batch()
| std::optional< Batch > pulsatrix::DataLoader::next_batch |
( |
| ) |
|
Fetches the next batch.
- Returns
- The next Batch, or std::nullopt once the epoch is exhausted (or, with drop_last=true, once fewer than batch_size samples remain).
◆ num_batches()
| int64_t pulsatrix::DataLoader::num_batches |
( |
| ) |
const |
Number of batches per epoch.
- Exceptions
-
◆ reset_epoch()
| void pulsatrix::DataLoader::reset_epoch |
( |
| ) |
|
Resets to the start of a new epoch (re-seeds/reshuffles the sampler, or resets the stream).
The documentation for this class was generated from the following file: