Public Types | |
using | BatchProducer = std::function< optional< Batch >()> |
Public Member Functions | |
ValidIterator (BatchProducer next_batch) | |
void | next () override |
Fetches the next batch. | |
Batch & | get () override |
Returns the current batch. More... | |
bool | operator== (const IteratorImpl< Batch > &other) const override |
Does double dispatch. | |
bool | operator== (const SentinelIterator< Batch > &) const override |
A ValidIterator is equal to the SentinelIterator iff. More... | |
bool | operator== (const ValidIterator< Batch > &other) const override |
Returns true if the memory address of other equals that of this . | |
void | lazy_initialize () const |
Gets the very first batch if it has not yet been fetched. | |
Data Fields | |
BatchProducer | next_batch_ |
optional< Batch > | batch_ |
bool | initialized_ = false |
Definition at line 26 of file iterator.h.
|
inlineoverridevirtual |
Returns the current batch.
The precondition for this operation to not throw an exception is that it has been compared to the SentinelIterator
and did not compare equal.
Implements torch::data::detail::IteratorImpl< Batch >.
Definition at line 62 of file iterator.h.
|
inlineoverridevirtual |
A ValidIterator
is equal to the SentinelIterator
iff.
the ValidIterator
has reached the end of the dataloader.
Implements torch::data::detail::IteratorImpl< Batch >.
Definition at line 78 of file iterator.h.