Skip to main content

DataLoaderTrait

Trait DataLoaderTrait 

Source
pub trait DataLoaderTrait<D: Dataset, C: Collate<D::Item>> {
    // Required methods
    fn len(&self) -> usize;
    fn is_empty(&self) -> bool;
}
Expand description

Trait for DataLoader functionality

Required Methods§

Source

fn len(&self) -> usize

Get the number of batches

Source

fn is_empty(&self) -> bool

Check if the dataloader is empty

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<D, S, C> DataLoaderTrait<D, C> for DataLoader<D, S, C>
where D: Dataset + Sync, S: BatchSampler + Sync, C: Collate<D::Item> + Sync, D::Item: Send, C::Output: Send, S::Iter: Iterator<Item = Vec<usize>>,