code: def test_multiclass_wrong_inputs():
      cm = ConfusionMatrix(10)
  
      with pytest.raises(
          ValueError,
          match=r"y_pred must have shape \(batch_size, num_classes "
          r"\(currently set to 10\), ...\)",
      ):
          cm.update(
              (torch.rand(10), torch.randint(0, 2, size=(10,)).long())
          )
  
      with pytest.raises(
          ValueError,
          match=r"y_pred does not have correct number of classes:",
      ):
          cm.update(
              (
                  torch.rand(10, 5, 4),
                  torch.randint(0, 2, size=(10,)).long(),
              )
          )
  
      with pytest.raises(
          ValueError,
          match=r"y_pred must have shape \(batch_size, num_classes "
          r"\(currently set to 10\), ...\) "
          r"and y must have ",
      ):
          cm.update(
              (
                  torch.rand(4, 10, 12, 12),
                  torch.randint(0, 10, size=(10,)).long(),
              )
          )
  
      with pytest.raises(
          ValueError, match=r"y and y_pred must have compatible shapes."
      ):
          cm.update(
              (
                  torch.rand(4, 10, 12, 14),
                  torch.randint(0, 10, size=(4, 5, 6)).long(),
              )
          )
  
      with pytest.raises(
          ValueError, match=r"Argument average can None or one of"
      ):
          ConfusionMatrix(num_classes=10, average="abc")
  
      with pytest.raises(
          ValueError,
          match=r"Argument average should be one of 'samples', 'recall', 'precision'",
      ):
          ConfusionMatrix.normalize(None, None)
  
imports: import os
  import numpy
  import pytest
  import torch
  from sklearn.metrics import accuracy_score, confusion_matrix, precision_score, recall_score
  import ignite.distributed
  from ignite.exceptions import NotComputableError
  from ignite.metrics import ConfusionMatrix, IoU, JaccardIndex, mIoU
  from ignite.metrics.confusion_matrix import cmAccuracy, cmPrecision, cmRecall, DiceCoefficient
label_desc: Use image node_id 3 for calling a global function with example usage: test_multiclass_wrong_inputs() without return types