pub struct WindowsDataset<D, I> {
    pub size: NonZeroUsize,
    /* private fields */
}Expand description
Dataset designed to work with overlapping windows of data.
Fields§
§size: NonZeroUsizeThe size of the windows.
Implementations§
Source§impl<D, I> WindowsDataset<D, I>where
    D: Dataset<I>,
 
impl<D, I> WindowsDataset<D, I>where
    D: Dataset<I>,
Trait Implementations§
Auto Trait Implementations§
impl<D, I> Freeze for WindowsDataset<D, I>where
    D: Freeze,
impl<D, I> RefUnwindSafe for WindowsDataset<D, I>where
    D: RefUnwindSafe,
    I: RefUnwindSafe,
impl<D, I> Send for WindowsDataset<D, I>
impl<D, I> Sync for WindowsDataset<D, I>
impl<D, I> Unpin for WindowsDataset<D, I>
impl<D, I> UnwindSafe for WindowsDataset<D, I>where
    D: UnwindSafe,
    I: UnwindSafe,
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
}