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 2017/12/29 18:26:28 UTC

[GitHub] ZiyueHuang commented on a change in pull request #9228: raise err in io.NDArrayIter for invalid usecase

ZiyueHuang commented on a change in pull request #9228: raise err in io.NDArrayIter for invalid usecase
URL: https://github.com/apache/incubator-mxnet/pull/9228#discussion_r159090226
 
 

 ##########
 File path: python/mxnet/io.py
 ##########
 @@ -515,17 +515,10 @@ def _init_data(data, allow_empty, default_name):
     return list(data.items())
 
 def _has_instance(data, dtype):
-    """return True if data has instance of dtype"""
-    if isinstance(data, dtype):
-        return True
-    if isinstance(data, list):
-        for v in data:
-            if isinstance(v, dtype):
-                return True
-    if isinstance(data, dict):
-        for v in data.values():
-            if isinstance(v, dtype):
-                return True
+    """return True if data has instance of dtype after _init_data"""
+    for item in data:
+        if isinstance(item[1], dtype):
 
 Review comment:
   This function is called after _init_data which transforms the data to [ ( name, ndarray), ... ] format.

----------------------------------------------------------------
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