Skip to content

Commit

Permalink
Update documentation for MXNetDataIter in io.py (apache#6000) (apache…
Browse files Browse the repository at this point in the history
…#6113)

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

* [DOC] Respond to feedback (apache#6113)
  • Loading branch information
danithaca authored and Olivier committed May 30, 2017
1 parent ddc80b6 commit 2277640
Showing 1 changed file with 19 additions and 2 deletions.
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.
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

0 comments on commit 2277640

Please sign in to comment.