dataloader-rs 0.1.0

High-performance DataLoader for Rust with a PyTorch-like interface
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mod batch_sampler;
mod distributed;
mod random;
mod sequential;

pub use batch_sampler::BatchSampler;
pub use distributed::DistributedSampler;
pub use random::RandomSampler;
pub use sequential::SequentialSampler;

/// Produces an ordered sequence of indices for one full pass over a dataset.
pub trait Sampler: Send + 'static {
    /// Return the index sequence for one epoch over a dataset of `dataset_len`
    /// items.
    fn indices(&mut self, dataset_len: usize) -> Vec<usize>;
}