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))
Test that corner case for power=1.0 produce valid result.
def test_corner_case_for_power_at_1(metric_class=TweedieDevianceScore):
    
    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))