class_docstr: Test class for `TweedieDevianceScore` metric.
class_docstr_tok: ["Test","class","for","`","TweedieDevianceScore","`","metric","."]
docstr: Test dtype support of the metric on CPU.
docstr_tok: ["Test","dtype","support","of","the","metric","on","CPU","."]
code: def test_deviance_scores_half_cpu(self, preds, target, power):
      """Test dtype support of the metric on CPU."""
      if power in [1, 2]:
          pytest.skip(
              "Tweedie Deviance Score half + cpu does not work for power=[1,2] due to missing support in torch.log"
          )
      metric_args = {"power": power}
      self.run_precision_test_cpu(
          preds,
          target,
          metric_module=TweedieDevianceScore,
          metric_functional=tweedie_deviance_score,
          metric_args=metric_args,
      )
  
imports: from functools import partial
  import pytest
  import torch
  from sklearn.metrics import mean_tweedie_deviance
  from torch import Tensor
  from torchmetrics.functional.regression.tweedie_deviance import tweedie_deviance_score
  from torchmetrics.regression.tweedie_deviance import TweedieDevianceScore
  from unittests import BATCH_SIZE, NUM_BATCHES, _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 4 for calling the TestDevianceScore obj's underlying member method code with example usage: obj.test_deviance_scores_half_cpu(preds, target, power) without return types