pub struct MapperDataset<D, M, I> { /* private fields */ }Expand description
Dataset mapping each element in an inner dataset to another element type lazily.
Implementations§
Source§impl<D, M, I> MapperDataset<D, M, I>
impl<D, M, I> MapperDataset<D, M, I>
Trait Implementations§
Source§impl<D, M, I, O> Dataset<O> for MapperDataset<D, M, I>
impl<D, M, I, O> Dataset<O> for MapperDataset<D, M, I>
Auto Trait Implementations§
impl<D, M, I> Freeze for MapperDataset<D, M, I>
impl<D, M, I> RefUnwindSafe for MapperDataset<D, M, I>
impl<D, M, I> Send for MapperDataset<D, M, I>
impl<D, M, I> Sync for MapperDataset<D, M, I>
impl<D, M, I> Unpin for MapperDataset<D, M, I>
impl<D, M, I> UnwindSafe for MapperDataset<D, M, I>
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<I, T> Windows<I> for Twhere
T: Dataset<I>,
impl<I, T> Windows<I> for Twhere
T: Dataset<I>,
Source§fn windows(&self, size: usize) -> WindowsIterator<'_, I> ⓘ
fn windows(&self, size: usize) -> WindowsIterator<'_, I> ⓘ
Is empty if the Dataset is shorter than size.
§Panics
Panics if size is 0.
§Examples
use crate::burn_dataset::{
transform::{Windows, WindowsDataset},
Dataset, InMemDataset,
};
let items = [1, 2, 3, 4].to_vec();
let dataset = InMemDataset::new(items.clone());
for window in dataset.windows(2) {
// do sth with window
}