def compute_metrics(p):
        """Computes accuracy on a batch of predictions"""
        logits, label_ids = p
        predictions = np.argmax(logits, axis=-1)
        metrics = metric.compute(predictions=predictions, references=label_ids)
        return metrics
Computes accuracy on a batch of predictions
dpkd/transformers/examples/tensorflow/image-classification/run_image_classification.py