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

 ##########
 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:
   done

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to