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/06/07 18:04:36 UTC

[GitHub] sandeep-krishnamurthy commented on a change in pull request #11189: Adding support for dict in infer_shape

sandeep-krishnamurthy commented on a change in pull request #11189: Adding support for dict in  infer_shape
URL: https://github.com/apache/incubator-mxnet/pull/11189#discussion_r193839549
 
 

 ##########
 File path: python/mxnet/symbol/symbol.py
 ##########
 @@ -1078,11 +1078,22 @@ def _infer_shape_impl(self, partial, *args, **kwargs):
             keys = c_array(ctypes.c_char_p, [])
             for i, s in enumerate(args):
                 if s is not None:
-                    if not isinstance(s, tuple):
-                        raise TypeError("Arguments need to be shapes (tuple), "
-                                        "but argument %d is %s." % (i, type(s)))
-                    sdata.extend(s)
-                indptr.append(len(sdata))
+                    if isinstance(s, dict):
+                        str_keys = []
+                        for k, v in s.items():
+                            if not isinstance(v, tuple):
+                                raise TypeError("Arguments need to be shapes (tuple), "
 
 Review comment:
   Thanks for this fix.
   
   1. Same checks in 2 places. Please refactor.
   2. Validation on k?
   3. indptr.append(..) can be moved of this logic.

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