Struct burn_core::data::dataloader::BatchDataLoader
source · pub struct BatchDataLoader<I, O> { /* private fields */ }Expand description
A data loader that can be used to iterate over a dataset in batches.
Implementations§
source§impl<I, O> BatchDataLoader<I, O>
impl<I, O> BatchDataLoader<I, O>
sourcepub fn new(
strategy: Box<dyn BatchStrategy<I>>,
dataset: Arc<dyn Dataset<I>>,
batcher: Box<dyn DynBatcher<I, O>>,
rng: Option<StdRng>
) -> Self
pub fn new( strategy: Box<dyn BatchStrategy<I>>, dataset: Arc<dyn Dataset<I>>, batcher: Box<dyn DynBatcher<I, O>>, rng: Option<StdRng> ) -> Self
source§impl<I, O> BatchDataLoader<I, O>
impl<I, O> BatchDataLoader<I, O>
sourcepub fn multi_thread(
strategy: Box<dyn BatchStrategy<I>>,
dataset: Arc<dyn Dataset<I>>,
batcher: Box<dyn DynBatcher<I, O>>,
num_threads: usize,
rng: Option<StdRng>
) -> MultiThreadDataLoader<O>
pub fn multi_thread( strategy: Box<dyn BatchStrategy<I>>, dataset: Arc<dyn Dataset<I>>, batcher: Box<dyn DynBatcher<I, O>>, num_threads: usize, rng: Option<StdRng> ) -> MultiThreadDataLoader<O>
Trait Implementations§
source§impl<I, O> Clone for BatchDataLoader<I, O>
impl<I, O> Clone for BatchDataLoader<I, O>
source§impl<I, O> DataLoader<O> for BatchDataLoader<I, O>
impl<I, O> DataLoader<O> for BatchDataLoader<I, O>
Auto Trait Implementations§
impl<I, O> Freeze for BatchDataLoader<I, O>
impl<I, O> !RefUnwindSafe for BatchDataLoader<I, O>
impl<I, O> Send for BatchDataLoader<I, O>
impl<I, O> !Sync for BatchDataLoader<I, O>
impl<I, O> Unpin for BatchDataLoader<I, O>
impl<I, O> !UnwindSafe for BatchDataLoader<I, O>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<D, O> DynDataLoader<O> for Dwhere
D: DataLoader<O> + Clone + 'static,
impl<D, O> DynDataLoader<O> for Dwhere
D: DataLoader<O> + Clone + 'static,
source§fn clone_dyn(&self) -> Box<dyn DynDataLoader<O>>
fn clone_dyn(&self) -> Box<dyn DynDataLoader<O>>
Clone the dataloader and returns a new one.
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more