Table Of Contents
Table Of Contents

class, data_name='data', label_name='softmax_label', **_)[source]

A python wrapper a C++ data iterator.

This iterator is the Python wrapper to all native C++ data iterators, such as CSVIter, ImageRecordIter, MNISTIter, etc. When initializing CSVIter for example, you will get an MXDataIter instance to use in your Python code. Calls to next, reset, etc will be delegated to the underlying C++ data iterators.

Usually you don’t need to interact with MXDataIter directly unless you are implementing your own data iterators in C++. To do that, please refer to examples under the src/io folder.

  • handle (DataIterHandle, required) – The handle to the underlying C++ Data Iterator.
  • data_name (str, optional) – Data name. Default to “data”.
  • label_name (str, optional) – Label name. Default to “softmax_label”.

See also

src/io : The underlying C++ data iterator implementation, e.g., CSVIter.

__init__(handle, data_name='data', label_name='softmax_label', **_)[source]

Initialize self. See help(type(self)) for accurate signature.


__init__(handle[, data_name, label_name]) Initialize self.
getdata() Get data of current batch.
getindex() Get index of the current batch.
getlabel() Get label of the current batch.
getpad() Get the number of padding examples in the current batch.
iter_next() Move to the next batch.
next() Get next data batch from iterator.
reset() Reset the iterator to the begin of the data.