class_docstr: Test class for `TotalVariation` metric.
class_docstr_tok: ["Test","class","for","`","TotalVariation","`","metric","."]
docstr: Test class implementation of metric.
docstr_tok: ["Test","class","implementation","of","metric","."]
code: def test_total_variation(self, preds, target, reduction, ddp):
      """Test class implementation of metric."""
      if reduction is None and ddp:
          pytest.skip(
              "reduction=None and ddp=True runs out of memory on CI hardware, but it does work"
          )
      self.run_class_metric_test(
          ddp,
          preds,
          target,
          TotalVariationTester,
          partial(_total_variation_kornia_tester, reduction=reduction),
          metric_args={"reduction": reduction},
      )
  
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 1 for calling the TestTotalVariation obj's underlying member method code with example usage: obj.test_total_variation(preds, target, reduction, ddp) without return types