MXNet Plugin API reference¶
-
class
nvidia.dali.plugin.mxnet.
DALIClassificationIterator
(pipelines, size, data_name='data', label_name='softmax_label', data_layout='NCHW', fill_last_batch=True)¶ DALI iterator for classification tasks for MXNet. It returns 2 outputs (data and label) in the form of MXNet’s DataBatch of NDArrays.
Calling
DALIClassificationIterator(pipelines, size, data_name, label_name, data_layout)
is equivalent to calling
DALIGenericIterator(pipelines, ["data", "label"], size, data_name, label_name, data_layout)
Parameters: - pipelines (list of nvidia.dali.pipeline.Pipeline) – List of pipelines to use
- size (int) – Epoch size.
- data_name (str, optional, default = 'data') – Data name for provided symbols.
- label_name (str, optional, default = 'softmax_label') – Label name for provided symbols.
- data_layout (str, optional, default = 'NCHW') – Either ‘NHWC’ or ‘NCHW’ - layout of the pipeline outputs.
- fill_last_batch (bool, optional, default = True) – Whether to fill the last batch with the data from the next epoch.
-
next
()¶ Returns the next batch of data.
-
reset
()¶ Resets the iterator after the full epoch. DALI iterators do not support resetting before the end of the epoch and will ignore such request.
-
class
nvidia.dali.plugin.mxnet.
DALIGenericIterator
(pipelines, output_map, size, data_name='data', label_name='softmax_label', data_layout='NCHW', fill_last_batch=True)¶ General DALI iterator for MXNet. It can return any number of outputs from the DALI pipeline in the form of MXNet’s DataBatch of NDArrays.
Parameters: - pipelines (list of nvidia.dali.pipeline.Pipeline) – List of pipelines to use
- output_map (list of str) – List of strings (either “data” or “label”) which maps the output of DALI pipeline to proper field in MXNet’s DataBatch
- size (int) – Epoch size.
- data_name (str, optional, default = 'data') – Data name for provided symbols.
- label_name (str, optional, default = 'softmax_label') – Label name for provided symbols.
- data_layout (str, optional, default = 'NCHW') – Either ‘NHWC’ or ‘NCHW’ - layout of the pipeline outputs.
- fill_last_batch (bool, optional, default = True) – Whether to fill the last batch with the data from the next epoch.
-
next
()¶ Returns the next batch of data.
-
reset
()¶ Resets the iterator after the full epoch. DALI iterators do not support resetting before the end of the epoch and will ignore such request.
-
nvidia.dali.plugin.mxnet.
feed_ndarray
(dali_tensor, arr)¶ Copy contents of DALI tensor to MXNet’s NDArray.
Parameters: - dali_tensor (nvidia.dali.backend.TensorCPU or nvidia.dali.backend.TensorGPU) – Tensor from which to copy
- arr (mxnet.nd.NDArray) – Destination of the copy