Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Update documentation for MXNetDataIter in io.py (#6000) #6113

Merged
merged 4 commits into from
May 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions python/mxnet/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,10 +670,28 @@ def getpad(self):
class MXDataIter(DataIter):
"""A python wrapper a C++ data iterator.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elaborate. this outputs one data blob and one label blob, etc, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"this outputs one data blob and one label blob" seems to already get taken care of in the DataIter documentation. I guess no need to repeat it in the MXDataIter doc. Let me know if there are other things I should explain. Thanks!!

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.

Parameters
----------
handle : DataIterHandle
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`.
"""
def __init__(self, handle, data_name='data', label_name='softmax_label', **_):
super(MXDataIter, self).__init__()
Expand All @@ -692,7 +710,6 @@ def __init__(self, handle, data_name='data', label_name='softmax_label', **_):
self.provide_label = [DataDesc(label_name, label.shape, label.dtype)]
self.batch_size = data.shape[0]


def __del__(self):
check_call(_LIB.MXDataIterFree(self.handle))

Expand Down