You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/01/31 16:42:07 UTC

[GitHub] szha commented on a change in pull request #9645: Fix DataBatch.__str__ for cases where we don't have labels.

szha commented on a change in pull request #9645: Fix DataBatch.__str__ for cases where we don't have labels.
URL: https://github.com/apache/incubator-mxnet/pull/9645#discussion_r165112582
 
 

 ##########
 File path: tests/python/unittest/test_io.py
 ##########
 @@ -252,6 +252,16 @@ def check_libSVMIter_news_data():
     check_libSVMIter_synthetic()
     check_libSVMIter_news_data()
 
+
+def test_DataBatch():
+    from nose.tools import eq_
+    from mxnet.io import DataBatch
+    batch = DataBatch(data=[mx.nd.ones((2,3))])
+    eq_(str(batch),'DataBatch: data shapes: [(2, 3)] label shapes: None')
+    batch = DataBatch(data=[mx.nd.ones((2,3)), mx.nd.ones((7,8))], label=[mx.nd.ones((4,5))])
+    eq_(str(batch),'DataBatch: data shapes: [(2, 3), (7, 8)] label shapes: [(4, 5)]')
 
 Review comment:
   space after comma

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services