pub trait DataLoader {
// Required methods
fn get_size(
&self,
slice: Option<DataSlice>,
) -> Result<Vec<usize>, AutoDiffError>;
fn get_item(
&self,
index: usize,
slice: Option<DataSlice>,
) -> Result<(Var, Var), AutoDiffError>;
fn get_batch(
&self,
start: usize,
end: usize,
slice: Option<DataSlice>,
) -> Result<(Var, Var), AutoDiffError>;
// Provided method
fn get_indexed_batch(
&self,
index: &[usize],
slice: Option<DataSlice>,
) -> Result<(Var, Var), AutoDiffError> { ... }
}Required Methods§
Sourcefn get_size(
&self,
slice: Option<DataSlice>,
) -> Result<Vec<usize>, AutoDiffError>
fn get_size( &self, slice: Option<DataSlice>, ) -> Result<Vec<usize>, AutoDiffError>
The shape of the data if applicable.
Provided Methods§
Sourcefn get_indexed_batch(
&self,
index: &[usize],
slice: Option<DataSlice>,
) -> Result<(Var, Var), AutoDiffError>
fn get_indexed_batch( &self, index: &[usize], slice: Option<DataSlice>, ) -> Result<(Var, Var), AutoDiffError>
Return a batch given the index.