code: def test_error_on_different_shape(metric_class):
      """Test that error is raised on different shapes of input."""
      metric = metric_class()
      with pytest.raises(
          RuntimeError,
          match="Predictions and targets are expected to have the same shape",
      ):
          metric(torch.randn(100), torch.randn(50))
  
imports: import math
  from functools import partial
  from typing import Optional
  import numpy
  import pytest
  import torch
  from sklearn.metrics import mean_absolute_error
  from sklearn.metrics import mean_absolute_percentage_error
  from sklearn.metrics import mean_squared_error
  from sklearn.metrics import mean_squared_log_error
  from sklearn.metrics._regression import _check_reg_targets
  from sklearn.utils import check_consistent_length
  from torchmetrics.functional import mean_absolute_error, mean_absolute_percentage_error, mean_squared_error, mean_squared_log_error, weighted_mean_absolute_percentage_error
  from torchmetrics.functional.regression.symmetric_mape import symmetric_mean_absolute_percentage_error
  from torchmetrics.regression import MeanAbsoluteError, MeanAbsolutePercentageError, MeanSquaredError, MeanSquaredLogError, WeightedMeanAbsolutePercentageError
  from torchmetrics.regression.symmetric_mape import SymmetricMeanAbsolutePercentageError
  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 5 for calling a global function with example usage: test_error_on_different_shape(metric_class) without return types