class_docstr: Test class for `TotalVariation` metric.
class_docstr_tok: ["Test","class","for","`","TotalVariation","`","metric","."]
docstr: Test for half precision on GPU.
docstr_tok: ["Test","for","half","precision","on","GPU","."]
code: def test_sam_half_gpu(self, preds, target, reduction):
      """Test for half precision on GPU."""
      self.run_precision_test_gpu(
          preds, target, TotalVariationTester, _total_variaion_tester
      )
  
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 4 for calling the TestTotalVariation obj's underlying member method code with example usage: obj.test_sam_half_gpu(preds, target, reduction) without return types