code: def test_corner_case_for_power_at_1(
      metric_class=TweedieDevianceScore,
  ):
      """Test that corner case for power=1.0 produce valid result."""
      metric = TweedieDevianceScore()
      targets = torch.tensor([0, 1, 0, 1])
      preds = torch.tensor([0.1, 0.1, 0.1, 0.1])
      val = metric(preds, targets)
      assert val != 0.0
      assert not torch.isnan(val)
  
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 a global function with example usage: test_corner_case_for_power_at_1(metric_class) without return types