pub struct DatasetStream<'a> { /* private fields */ }Expand description
A Dataset read as batches, from Dataset::stream.
It holds the dataset mutably because shuffling between epochs rewrites it.
Trait Implementations§
Source§impl BatchSource for DatasetStream<'_>
impl BatchSource for DatasetStream<'_>
Source§fn next_batch(&mut self) -> Result<Option<DatasetBatch<'_>>, NetworkError>
fn next_batch(&mut self) -> Result<Option<DatasetBatch<'_>>, NetworkError>
The next batch of the current epoch, or
None once the epoch is spent. Read moreSource§fn start_epoch(&mut self, epoch: usize) -> Result<(), NetworkError>
fn start_epoch(&mut self, epoch: usize) -> Result<(), NetworkError>
Starts an epoch. An in-memory source reshuffles here; a file-backed one
seeks back to the beginning. Read more
Source§fn skip_batches(&mut self, batches: usize) -> Result<(), NetworkError>
fn skip_batches(&mut self, batches: usize) -> Result<(), NetworkError>
Discards the next
batches batches of this epoch, which is how
Network::fit_stream_resuming
returns to a saved BatchCursor. Read moreAuto Trait Implementations§
impl<'a> !UnwindSafe for DatasetStream<'a>
impl<'a> Forget for DatasetStream<'a>
impl<'a> Freeze for DatasetStream<'a>
impl<'a> Move for DatasetStream<'a>
impl<'a> RefUnwindSafe for DatasetStream<'a>
impl<'a> Send for DatasetStream<'a>
impl<'a> Sync for DatasetStream<'a>
impl<'a> Unpin for DatasetStream<'a>
impl<'a> UnsafeUnpin for DatasetStream<'a>
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<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