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

2018-03-01 Thread GitBox
hetong007 commented on a change in pull request #9930: Support single array 
input for metric
URL: https://github.com/apache/incubator-mxnet/pull/9930#discussion_r171671073
 
 

 ##
 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:
   Why don't we check both length and shape? I assume they shoud always match.


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:
us...@infra.apache.org


With regards,
Apache Git Services


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

2018-02-28 Thread GitBox
hetong007 commented on a change in pull request #9930: Support single array 
input for metric
URL: https://github.com/apache/incubator-mxnet/pull/9930#discussion_r171436622
 
 

 ##
 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:
   @piiswrong can we have your input?


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:
us...@infra.apache.org


With regards,
Apache Git Services


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

2018-02-28 Thread GitBox
hetong007 commented on a change in pull request #9930: Support single array 
input for metric
URL: https://github.com/apache/incubator-mxnet/pull/9930#discussion_r171428505
 
 

 ##
 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:
   Is there a reason to set `shape=0` by default?


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:
us...@infra.apache.org


With regards,
Apache Git Services