reminisce commented on a change in pull request #10425: [MXNET-175] 
NdArrayiterator dict fix
URL: https://github.com/apache/incubator-mxnet/pull/10425#discussion_r181136501
 
 

 ##########
 File path: tests/python/unittest/test_io.py
 ##########
 @@ -313,6 +313,20 @@ def check_CSVIter_synthetic():
 
     check_CSVIter_synthetic()
 
+
+def test_DictData_NDIterator():
+    train_iter = mx.io.NDArrayIter({
+        'i0': mx.nd.zeros(5, ),
+        'i1': mx.nd.ones(5, ),
+    }, batch_size=5)
+
+    net = mx.sym.var('i1')
+    mod = mx.module.Module(net, ['i1'], None)
+    mod.bind([('i1', (5,))], None)
+    mod.init_params()
+    mod.predict(train_iter)
+    assert_almost_equal(mod.get_outputs()[0].asnumpy(), np.ones(shape=(5,)))
 
 Review comment:
   Please add more unit tests to increase test coverage, including assert 
exception.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to