code: def _total_variation_kornia_tester(preds, target, reduction):
      score = kornia_total_variation(preds).sum(-1)
      if reduction == "sum":
          return score.sum()
      if reduction == "mean":
          return score.mean()
      return score
  
imports: from functools import partial
  from typing import Any
  import pytest
  import torch
  from kornia.losses import total_variation
  from torchmetrics.functional.image.tv import total_variation
  from torchmetrics.image.tv import TotalVariation
  from unittests import _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 2 for calling a global function with example usage: _total_variation_kornia_tester(preds, target, reduction) and returns: score, score, score