Template Struct ValidIterator¶
Defined in File iterator.h
Page Contents
Inheritance Relationships¶
Base Type¶
public torch::data::detail::IteratorImpl< Batch >
(Template Struct IteratorImpl)
Struct Documentation¶
-
template<typename Batch>
struct ValidIterator : public torch::data::detail::IteratorImpl<Batch>¶ -
Public Functions
-
inline explicit ValidIterator(BatchProducer next_batch)¶
-
inline virtual void next() override¶
Fetches the next batch.
-
inline virtual Batch &get() override¶
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.
-
inline virtual bool operator==(const IteratorImpl<Batch> &other) const override¶
Does double dispatch.
-
inline virtual bool operator==(const SentinelIterator<Batch>&) const override¶
A
ValidIterator
is equal to theSentinelIterator
iff.the
ValidIterator
has reached the end of the dataloader.
-
inline virtual bool operator==(const ValidIterator<Batch> &other) const override¶
Returns true if the memory address of
other
equals that ofthis
.
-
inline void lazy_initialize() const¶
Gets the very first batch if it has not yet been fetched.
-
inline explicit ValidIterator(BatchProducer next_batch)¶