Shortcuts

Template Class Iterator

Page Contents

Class Documentation

template<typename Batch>
class Iterator

Public Types

using difference_type = std::ptrdiff_t
using value_type = Batch
using pointer = Batch*
using reference = Batch&
using iterator_category = std::input_iterator_tag

Public Functions

inline explicit Iterator(std::unique_ptr<detail::IteratorImpl<Batch>> impl)
inline Iterator &operator++()

Increments the iterator.

Only permitted for valid iterators (not past the end).

inline Batch &operator*()

Returns the current batch.

Only permitted for valid iterators (not past the end).

inline Batch *operator->()

Returns a pointer to the current batch.

Only permitted for valid iterators (not past the end).

inline bool operator==(const Iterator &other) const

Compares two iterators for equality.

inline bool operator!=(const Iterator &other) const

Compares two iterators for inequality.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources