From ff1deacac9c838ce754676c1dad4d3e5b0cb100a Mon Sep 17 00:00:00 2001 From: Daniel Zhou Date: Thu, 4 May 2017 16:48:02 -0700 Subject: [PATCH 1/2] Update documentation for MXNetDataIter in io.py (#6000) --- python/mxnet/io.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python/mxnet/io.py b/python/mxnet/io.py index d5a9ffc938ac..7b102c85902a 100644 --- a/python/mxnet/io.py +++ b/python/mxnet/io.py @@ -577,8 +577,16 @@ class MXDataIter(DataIter): 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 + -------- + c_api.cc : The underlying C++ data iterator implementation. """ def __init__(self, handle, data_name='data', label_name='softmax_label', **_): super(MXDataIter, self).__init__() @@ -597,7 +605,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)) From 187a57e71d940fa7ebde45679448a643b82d3d89 Mon Sep 17 00:00:00 2001 From: Daniel Zhou Date: Tue, 23 May 2017 16:28:37 -0700 Subject: [PATCH 2/2] [DOC] Respond to feedback (#6113) --- python/mxnet/io.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python/mxnet/io.py b/python/mxnet/io.py index c46bc44b5184..6366dd9b9177 100644 --- a/python/mxnet/io.py +++ b/python/mxnet/io.py @@ -670,6 +670,16 @@ 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, required @@ -681,7 +691,7 @@ class MXDataIter(DataIter): See Also -------- - c_api.cc : The underlying C++ data iterator implementation. + 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__()