Calculates the mean of the per-class accuracies.

Calculates the accuracy for each class, then takes the mean of that.

For estimation of the metric over a stream of data, the function creates an update_op operation that updates the accuracy of each class and returns them.

If weights is None, weights default to 1. Use weights of 0 to mask values.

labels A Tensor of ground truth labels with shape [batch size] and of type int32 or int64. The tensor will be flattened if its rank > 1.