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/11/28 18:28:16 UTC

[GitHub] vandanavk commented on a change in pull request #13413: fix for params with no dims in onnx

vandanavk commented on a change in pull request #13413: fix for params with no dims in onnx
URL: https://github.com/apache/incubator-mxnet/pull/13413#discussion_r237206118
 
 

 ##########
 File path: python/mxnet/contrib/onnx/onnx2mx/import_onnx.py
 ##########
 @@ -196,8 +197,11 @@ def _parse_array(self, tensor_proto):
         except ImportError:
             raise ImportError("Onnx and protobuf need to be installed. "
                               + "Instructions to install - https://github.com/onnx/onnx")
-        np_array = to_array(tensor_proto).reshape(tuple(tensor_proto.dims))
-        return nd.array(np_array)
+        if len(tuple(tensor_proto.dims)) > 0:
+            np_array = to_array(tensor_proto).reshape(tuple(tensor_proto.dims))
+        else:
+            np_array = np.array([to_array(tensor_proto)])
+            return nd.array(np_array)
 
 Review comment:
   this line should be outside the else

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