Trait burn::data::dataset::Dataset

pub trait Dataset<I>: Send + Sync {
    // Required methods
    fn get(&self, index: usize) -> Option<I>;
    fn len(&self) -> usize;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn iter(&self) -> DatasetIterator<'_, I> 
       where Self: Sized { ... }
}
Expand description

The dataset trait defines a basic collection of items with a predefined size.

Required Methods§

fn get(&self, index: usize) -> Option<I>

Gets the item at the given index.

fn len(&self) -> usize

Gets the number of items in the dataset.

Provided Methods§

fn is_empty(&self) -> bool

Checks if the dataset is empty.

fn iter(&self) -> DatasetIterator<'_, I>
where Self: Sized,

Returns an iterator over the dataset.

Trait Implementations§

§

impl<I> Dataset<I> for Box<dyn Dataset<I>>

§

fn get(&self, index: usize) -> Option<I>

Gets the item at the given index.
§

fn len(&self) -> usize

Gets the number of items in the dataset.
§

fn is_empty(&self) -> bool

Checks if the dataset is empty.
§

fn iter(&self) -> DatasetIterator<'_, I>
where Self: Sized,

Returns an iterator over the dataset.

Implementations on Foreign Types§

§

impl<D, I> Dataset<I> for Box<D>
where D: Dataset<I>,

§

fn get(&self, index: usize) -> Option<I>

§

fn len(&self) -> usize

§

impl<D, I> Dataset<I> for Arc<D>
where D: Dataset<I>,

§

fn get(&self, index: usize) -> Option<I>

§

fn len(&self) -> usize

§

impl<I> Dataset<I> for Box<dyn Dataset<I>>

§

fn get(&self, index: usize) -> Option<I>

§

fn len(&self) -> usize

§

impl<I> Dataset<I> for Arc<dyn Dataset<I>>

§

fn get(&self, index: usize) -> Option<I>

§

fn len(&self) -> usize

Implementors§

§

impl Dataset<ImageDatasetItem> for ImageFolderDataset

§

impl Dataset<MnistItem> for MnistDataset

§

impl<D, I> Dataset<Vec<I>> for WindowsDataset<D, I>
where D: Dataset<I>, I: Clone + Send + Sync,

§

impl<D, I> Dataset<I> for ComposedDataset<D>
where D: Dataset<I>, I: Clone,

§

impl<D, I> Dataset<I> for PartialDataset<D, I>
where D: Dataset<I>, I: Clone + Send + Sync,

§

impl<D, I> Dataset<I> for SamplerDataset<D, I>
where D: Dataset<I>, I: Send + Sync,

§

impl<D, I> Dataset<I> for ShuffledDataset<D, I>
where D: Dataset<I>, I: Clone + Send + Sync,

§

impl<D, M, I, O> Dataset<O> for MapperDataset<D, M, I>
where D: Dataset<I>, M: Mapper<I, O> + Send + Sync, I: Send + Sync, O: Send + Sync,

§

impl<I> Dataset<I> for InMemDataset<I>
where I: Clone + Send + Sync,

§

impl<I> Dataset<I> for SqliteDataset<I>