Adapts a pre-loaded MnistDataset (MnistIdxLoader::Load's output) onto the generic Dataset interface – minimal-diff retrofit (campaign_exai_dl_library_data_pipeline, Mission 4): MnistIdxLoader/MnistDataset themselves are unchanged, still exercised directly by mnist_loader_test.cpp; this adapter is purely additive, fulfilling mnist_loader.hpp's own note that a second real dataset is the moment to generalize.
More...
#include <mnist_dataset_adapter.hpp>
Adapts a pre-loaded MnistDataset (MnistIdxLoader::Load's output) onto the generic Dataset interface – minimal-diff retrofit (campaign_exai_dl_library_data_pipeline, Mission 4): MnistIdxLoader/MnistDataset themselves are unchanged, still exercised directly by mnist_loader_test.cpp; this adapter is purely additive, fulfilling mnist_loader.hpp's own note that a second real dataset is the moment to generalize.
◆ MnistDatasetAdapter()
◆ get()
| Sample pulsatrix::MnistDatasetAdapter::get |
( |
int64_t |
index | ) |
const |
|
inlineoverridevirtual |
- Exceptions
-
| std::out_of_range | if index is out of bounds. |
- Returns
- {image (1,1,28,28), label as a (1,) float Tensor} – the label conversion is the only new work here; the image Tensor is already batch-of-one shaped, matching this codebase's existing convention, so it is returned unchanged (deep-copied via Tensor's copy constructor, since Sample owns its fields).
Implements pulsatrix::Dataset.
◆ size()
| int64_t pulsatrix::MnistDatasetAdapter::size |
( |
| ) |
const |
|
inlineoverridevirtual |
The documentation for this class was generated from the following file: