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/03/01 00:03:07 UTC

[GitHub] sxjscience commented on a change in pull request #9930: Support single array input for metric

sxjscience commented on a change in pull request #9930: Support single array input for metric
URL: https://github.com/apache/incubator-mxnet/pull/9930#discussion_r171426781
 
 

 ##########
 File path: python/mxnet/metric.py
 ##########
 @@ -793,6 +793,8 @@ def update(self, labels, preds):
 
             if len(label.shape) == 1:
                 label = label.reshape(label.shape[0], 1)
+            if len(pred.shape) == 1:
+                pred = pred.reshape(pred.shape[0], 1)
 
 
 Review comment:
   I think we can also revise the `check_label_shapes` above to be `check_label_shapes(labels, preds, True)` to force the labels and preds have the same shape.

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