Shortcuts

Template Class Iterator

Page Contents

Class Documentation

template<typename Batch>
class torch::data::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

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

Increments the iterator.

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

Batch &operator*()

Returns the current batch.

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

Batch *operator->()

Returns a pointer to the current batch.

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

bool operator==(const Iterator &other) const

Compares two iterators for equality.

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