def METHOD_NAME(preds, target, reduction):
    score = kornia_total_variation(preds).sum(-1)
    if reduction == "sum":
        return score.sum()
    if reduction == "mean":
        return score.mean()
    return score