Trait burn::data::dataloader::DataLoader

pub trait DataLoader<O>: Send {
    // Required methods
    fn iter<'a>(&'a self) -> Box<dyn DataLoaderIterator<O, Item = O> + 'a>;
    fn num_items(&self) -> usize;
}
Expand description

A data loader that can be used to iterate over a dataset.

Required Methods§

fn iter<'a>(&'a self) -> Box<dyn DataLoaderIterator<O, Item = O> + 'a>

Returns a boxed iterator to iterate over the data loader.

fn num_items(&self) -> usize

The number of items (not the number of batches nor the number of iterations), corresponding to the items_total of the progress returned by the iterator.

Implementors§

§

impl<I, O> DataLoader<O> for BatchDataLoader<I, O>
where I: Send + Sync + Clone + 'static, O: Send + 'static,

§

impl<O> DataLoader<O> for MultiThreadDataLoader<O>
where O: Send + 'static + Debug,