Skip to content

Commit

Permalink
proper flatten in acc (apache#9619)
Browse files Browse the repository at this point in the history
  • Loading branch information
szha authored and piiswrong committed Jan 29, 2018
1 parent 5a5cd64 commit ed823b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/mxnet/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def update(self, labels, preds):
if pred_label.context != label.context:
pred_label = pred_label.as_in_context(label.context)

self.sum_metric += (pred_label.flatten() == label.flatten()).sum().asscalar()
self.sum_metric += (pred_label.reshape((-1,)) == label.reshape((-1,))).sum().asscalar()
self.num_inst += numpy.prod(pred_label.shape)


Expand Down

0 comments on commit ed823b2

Please sign in to comment.