code: def accuracy(batch, model_predictions):
    
    _, targets = batch
    model_predictions, targets = _make_list(model_predictions, targets)
    correct = []
    for (prediction, target) in zip(model_predictions, targets):
      predicted_class = np.argmax(prediction, axis=-1)
      correct.append(np.equal(predicted_class, target))
    return masked_mean(correct, targets)
docs: Calculate accuracy.