pulsatrix
Loading...
Searching...
No Matches
dataset.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include <stdexcept>
8#include <vector>
9
10#include "pulsatrix/tensor.hpp"
11
12namespace pulsatrix {
13
19struct Sample {
20 std::vector<Tensor> fields;
21};
22
33class Dataset {
34public:
35 virtual ~Dataset() = default;
36
38 [[nodiscard]] virtual int64_t size() const = 0;
39
48 [[nodiscard]] virtual Sample get(int64_t index) const = 0;
49};
50
51} // namespace pulsatrix
Random-access dataset abstraction – pulsatrix's analogue of PyTorch's torch.utils....
Definition dataset.hpp:33
virtual int64_t size() const =0
Number of samples in this dataset.
virtual Sample get(int64_t index) const =0
Loads one sample by index.
virtual ~Dataset()=default
Definition acquisition_functions.hpp:16
One dataset sample: an ordered list of Tensor fields (e.g. {features, label} or {image,...
Definition dataset.hpp:19
std::vector< Tensor > fields
Definition dataset.hpp:20
N-dimensional tensor – owns a buffer via DeviceBackend*, RAII (Rule of Five).