code: def test_error_on_different_shape():
      """Test that error is raised on different shapes of input."""
      metric = CriticalSuccessIndex(0.5)
      with pytest.raises(
          RuntimeError,
          match="Predictions and targets are expected to have the same shape",
      ):
          metric(torch.randn(100), torch.randn(50))
  
file_path: torchmetrics/tests/unittests/image/test_csi.py
imports: from functools import partial
  import pytest
  import torch
  from sklearn.metrics import jaccard_score
  from torchmetrics.functional.regression.csi import critical_success_index
  from torchmetrics.regression.csi import CriticalSuccessIndex
  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 2 for calling a global function with example usage: test_error_on_different_shape() without return types