pulsatrix
Loading...
Searching...
No Matches
pulsatrix::MnistDatasetAdapter Class Reference

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>

Inheritance diagram for pulsatrix::MnistDatasetAdapter:
Collaboration diagram for pulsatrix::MnistDatasetAdapter:

Public Member Functions

 MnistDatasetAdapter (MnistDataset dataset, DeviceBackend *backend)
 
int64_t size () const override
 Number of samples in this dataset.
 
Sample get (int64_t index) const override
 
- Public Member Functions inherited from pulsatrix::Dataset
virtual ~Dataset ()=default
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MnistDatasetAdapter()

pulsatrix::MnistDatasetAdapter::MnistDatasetAdapter ( MnistDataset  dataset,
DeviceBackend *  backend 
)
inline

Member Function Documentation

◆ get()

Sample pulsatrix::MnistDatasetAdapter::get ( int64_t  index) const
inlineoverridevirtual
Exceptions
std::out_of_rangeif 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

Number of samples in this dataset.

Implements pulsatrix::Dataset.


The documentation for this class was generated from the following file: