'Updates the internal evaluation result.
Parameters
labels : list of `NDArray`
The labels of the data.
preds : list of `NDArray`
Predicted values.'

def update(self, labels, preds):

    check_label_shapes(labels, preds)
    for (label, pred_label) in zip(labels, preds):
        if (pred_label.shape != label.shape):
            pred_label = ndarray.argmax(pred_label, axis=self.axis)
        pred_label = pred_label.asnumpy().astype('int32')
        label = label.asnumpy().astype('int32')
        check_label_shapes(label, pred_label)
        self.sum_metric += (pred_label.flat == label.flat).sum()
        self.num_inst += len(pred_label.flat)
