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 edc9ee8 commit 0ff26df
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 0ff26df

Please sign in to comment.