def METHOD_NAME(metric_function, predicted, ground_truth, params):
    """
    This function computes the output of a metric function.
    """
    metric_output = metric_function(predicted, ground_truth, params).detach().cpu()
    if metric_output.dim() == 0:
        return metric_output.item()
    else:
        temp = metric_output.tolist()
        # this check is needed for precision
        if len(temp) > 1:
            return temp
        else:
            return metric_output.item()