pub struct StackDataset<T> { /* private fields */ }Expand description
A dataset that returns aligned samples from a tuple of child datasets.
Implementations§
Source§impl<T> StackDataset<T>where
T: StackTuple,
impl<T> StackDataset<T>where
T: StackTuple,
Sourcepub fn new(datasets: T) -> Result<Self>
pub fn new(datasets: T) -> Result<Self>
Creates a stack from child datasets with equal lengths.
§Errors
Returns RustTorchError::InvalidDimensions when a child length
differs from the first child’s length.
Trait Implementations§
Source§impl<T> Dataset for StackDataset<T>where
T: StackTuple,
impl<T> Dataset for StackDataset<T>where
T: StackTuple,
Source§type Sample = <T as StackTuple>::Sample
type Sample = <T as StackTuple>::Sample
One owned item produced by the dataset.
Source§type Error = <T as StackTuple>::Error
type Error = <T as StackTuple>::Error
An error returned while loading a sample.
Source§fn get_batch(&self, indices: &[usize]) -> Result<Vec<Self::Sample>, Self::Error>
fn get_batch(&self, indices: &[usize]) -> Result<Vec<Self::Sample>, Self::Error>
Loads samples for one index batch. Read more
Source§fn get_batch_with_context(
&self,
indices: &[usize],
context: &WorkerContext,
) -> Result<Vec<Self::Sample>, Self::Error>
fn get_batch_with_context( &self, indices: &[usize], context: &WorkerContext, ) -> Result<Vec<Self::Sample>, Self::Error>
Loads one index batch with cooperative worker lifecycle context. Read more
impl<T> ReplaySafeDataset for StackDataset<T>where
T: StackTuple + ReplaySafeStackTuple,
Auto Trait Implementations§
impl<T> Freeze for StackDataset<T>where
T: Freeze,
impl<T> RefUnwindSafe for StackDataset<T>where
T: RefUnwindSafe,
impl<T> Send for StackDataset<T>where
T: Send,
impl<T> Sync for StackDataset<T>where
T: Sync,
impl<T> Unpin for StackDataset<T>where
T: Unpin,
impl<T> UnsafeUnpin for StackDataset<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for StackDataset<T>where
T: 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