code: def test_error_on_different_shape():
      """Test that error is raised on different shapes of input."""
      metric = MinkowskiDistance(5.1)
      with pytest.raises(
          RuntimeError,
          match="Predictions and targets are expected to have the same shape",
      ):
          metric(torch.randn(50), torch.randn(100))
  
file_path: torchmetrics/tests/unittests/regression/test_minkowski_distance.py
imports: from functools import partial
  import pytest
  import torch
  from scipy.spatial.distance import minkowski
  from torchmetrics.functional import minkowski_distance
  from torchmetrics.regression import MinkowskiDistance
  from torchmetrics.utilities.exceptions import TorchMetricsUserError
  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 3 for calling a global function with example usage: test_error_on_different_shape() without return types