code: def test_bad_compute_fn():
      def compute_fn(y_preds, y_targets):
          # Following will raise the error:
          # The size of tensor a (3) must match the size of tensor b (4)
          # at non-singleton dimension 1
          return torch.mean(y_preds - y_targets).item()
  
      em = EpochMetric(compute_fn)
  
      em.reset()
      output1 = (
          torch.rand(4, 3),
          torch.randint(0, 2, size=(4, 4), dtype=torch.long),
      )
      with pytest.warns(
          EpochMetricWarning,
          match=r"Probably, there can be a problem with `compute_fn`",
      ):
          em.update(output1)
  
file_path: ignite/tests/ignite/metrics/test_epoch_metric.py
imports: import pytest
  import torch
  import ignite.distributed
  from ignite.engine import Engine
  from ignite.metrics import EpochMetric
  from ignite.metrics.epoch_metric import EpochMetricWarning, NotComputableError
label_desc: Use image node_id 4 for calling a global function with example usage: test_bad_compute_fn() and returns: torch