def METHOD_NAME(self, model_global, b_use_test_dataset=False):
    model_global.eval()
    model_global.to(self.device)
    metrics = {
        "test_correct": 0,
        "test_loss": 0,
        "test_precision": 0,
        "test_recall": 0,
        "test_total": 0,
    }
    if b_use_test_dataset:
        test_data = self.local_test_data
    else:
        test_data = self.local_training_data
    with torch.no_grad():
        for batch_idx, (x, target) in enumerate(test_data):
            x = x.to(self.device)
            target = target.to(self.device)
            pred = model_global(x)
            loss = self.criterion(pred, target)  # pylint: disable=E1102
            if self.args.dataset == "stackoverflow_lr":
                predicted = (pred > 0.5).int()
                correct = predicted.eq(target).sum(axis=-1).eq(target.size(1)).sum()
                true_positive = ((target * predicted) > 0.1).int().sum(axis=-1)
                precision = true_positive / (predicted.sum(axis=-1) + 1e-13)
                recall = true_positive / (target.sum(axis=-1) + 1e-13)
                metrics["test_precision"] += precision.sum().item()
                metrics["test_recall"] += recall.sum().item()
            else:
                _, predicted = torch.max(pred, -1)
                correct = predicted.eq(target).sum()
            metrics["test_correct"] += correct.item()
            metrics["test_loss"] += loss.item() * target.size(0)
            metrics["test_total"] += target.size(0)
    return metrics