'Accumulate the performance according to `eval_metric` on all devices
by comparing outputs from [begin, end) to labels. By default use all
outputs.
Parameters
eval_metric : EvalMetric
The metric used for evaluation.
labels : list of NDArray
Typically comes from `label` of a `DataBatch`.
begin : int
Starting index of used outputs.
end : int or None
Ending index of used outputs.'

def update_metric(self, eval_metric, labels):

    for (texec, islice) in zip(self.execs, self.slices):
        labels_slice = []
        for (label, axis) in zip(labels, self.label_layouts):
            if (axis == 0):
                labels_slice.append(label[islice])
            elif (axis > 0):
                label_my_slice = nd.slice_axis(label, axis=axis, begin=islice.start, end=islice.stop).as_in_context(label.context)
                labels_slice.append(label_my_slice)
            else:
                labels_slice.append(label)
        labels_ = OrderedDict(zip(self.label_names, labels_slice))
        preds = OrderedDict(zip(self.output_names, texec.outputs))
        eval_metric.update_dict(labels_, preds)
