pub struct DataLoader<D, C> { /* private fields */ }
Expand description

For iterable dataset, the datalaoder will yield until the underlying iterator is None. As the iteration over the dataset can be done mutliple time, depending if the underlying dataset iterator consume the dataset or not.

Implementations§

source§

impl<D> DataLoader<D, DefaultCollate>where D: IntoIterator, DefaultCollate: Collate<D::Item>,

source

pub fn builder(dataset: D) -> Builder<D, DefaultCollate>

return a DataLoader builder.

source§

impl<'dataset, D, C> DataLoader<D, C>where D: 'dataset, &'dataset D: IntoIterator, C: Collate<<&'dataset D as IntoIterator>::Item>,

source

pub fn iter(&'dataset self) -> Iter<<&'dataset D as IntoIterator>::IntoIter, C>

Iterate over the dataloader without consuming the underlying dataset. As it make no sens to collate reference into a tensor, by default element are copied.

Trait Implementations§

source§

impl<D: Debug, C: Debug> Debug for DataLoader<D, C>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'dataset, D, C> IntoIterator for &'dataset DataLoader<D, C>where D: 'dataset, &'dataset D: IntoIterator, C: Collate<<&'dataset D as IntoIterator>::Item>,

§

type Item = <C as Collate<<&'dataset D as IntoIterator>::Item>>::Output

The type of the elements being iterated over.
§

type IntoIter = Iter<<&'dataset D as IntoIterator>::IntoIter, C>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<D, C> IntoIterator for DataLoader<D, C>where D: IntoIterator, C: Collate<<D as IntoIterator>::Item>,

§

type Item = <C as Collate<<D as IntoIterator>::Item>>::Output

The type of the elements being iterated over.
§

type IntoIter = IntoIter<<D as IntoIterator>::IntoIter, C>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<D, C> RefUnwindSafe for DataLoader<D, C>where C: RefUnwindSafe, D: RefUnwindSafe,

§

impl<D, C> Send for DataLoader<D, C>where C: Send, D: Send,

§

impl<D, C> Sync for DataLoader<D, C>where C: Sync, D: Sync,

§

impl<D, C> Unpin for DataLoader<D, C>where C: Unpin, D: Unpin,

§

impl<D, C> UnwindSafe for DataLoader<D, C>where C: UnwindSafe, D: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V