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/10/23 22:29:24 UTC

[GitHub] Roshrini commented on a change in pull request #12924: Fix wrong type for ONNX export of mean keepdims

Roshrini commented on a change in pull request #12924: Fix wrong type for ONNX export of mean keepdims
URL: https://github.com/apache/incubator-mxnet/pull/12924#discussion_r227587940
 
 

 ##########
 File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
 ##########
 @@ -1435,7 +1435,7 @@ def convert_mean(node, **kwargs):
     mx_axis = node.get("attrs", {}).get("axis", None)
     axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else None
 
-    keepdims = int(node.get("attrs", {}).get("keepdims", 0))
+    keepdims = int("True" == node.get("attrs", {}).get("keepdims", "False"))
 
 Review comment:
   How about using helper function "get_boolean_attribute_value"?
   keepdims = get_boolean_attribute_value(attrs, "keepdims")

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