def METHOD_NAME(metric_class=SpectralAngleMapper):
    """Test that error is raised if preds and target have different shape."""
    metric = metric_class()
    with pytest.raises(RuntimeError, match="Predictions and targets are expected to have the same shape.*"):
        metric(torch.randn([1, 3, 16, 16]), torch.randn([1, 1, 16, 16]))