code: def test_multiclass_wrong_inputs():
      cm = MultiLabelConfusionMatrix(10)
  
      with pytest.raises(
          ValueError,
          match=r"y_pred must at least have shape \(batch_size, num_classes \(currently set to 10\), ...\)",
      ):
          cm.update(
              (
                  torch.rand(10),
                  torch.randint(0, 2, size=(10, 10)).long(),
              )
          )
  
      with pytest.raises(
          ValueError,
          match=r"y must at least have shape \(batch_size, num_classes \(currently set to 10\), ...\)",
      ):
          cm.update(
              (
                  torch.rand(10, 10),
                  torch.randint(0, 2, size=(10,)).long(),
              )
          )
  
      with pytest.raises(
          ValueError,
          match=r"y_pred and y have different batch size: 10 vs 8",
      ):
          cm.update(
              (
                  torch.rand(10, 10),
                  torch.randint(0, 2, size=(8, 10)).long(),
              )
          )
  
      with pytest.raises(
          ValueError,
          match=r"y does not have correct number of classes: 9 vs 10",
      ):
          cm.update(
              (
                  torch.rand(10, 10),
                  torch.randint(0, 2, size=(10, 9)).long(),
              )
          )
  
      with pytest.raises(
          ValueError,
          match=r"y_pred does not have correct number of classes: 3 vs 10",
      ):
          cm.update(
              (
                  torch.rand(10, 3),
                  torch.randint(0, 2, size=(10, 10)).long(),
              )
          )
  
      with pytest.raises(
          ValueError, match=r"y and y_pred shapes must match."
      ):
          cm.update(
              (
                  torch.rand(10, 10, 2),
                  torch.randint(0, 2, size=(10, 10)).long(),
              )
          )
  
      with pytest.raises(
          ValueError,
          match=r"y_pred must be of any type: \(torch.uint8, torch.int8, torch.int16, torch.int32, torch.int64\)",
      ):
          cm.update((torch.rand(10, 10), torch.rand(10, 10)))
  
      with pytest.raises(
          ValueError,
          match=r"y must be of any type: \(torch.uint8, torch.int8, torch.int16, torch.int32, torch.int64\)",
      ):
          cm.update(
              (torch.rand(10, 10).type(torch.int32), torch.rand(10, 10))
          )
  
      with pytest.raises(
          ValueError, match=r"y_pred must be a binary tensor"
      ):
          y = torch.randint(0, 2, size=(10, 10)).long()
          y_pred = torch.randint(0, 2, size=(10, 10)).long()
          y_pred[0, 0] = 2
          cm.update((y_pred, y))
  
      with pytest.raises(
          ValueError, match=r"y must be a binary tensor"
      ):
          y = torch.randint(0, 2, size=(10, 10)).long()
          y_pred = torch.randint(0, 2, size=(10, 10)).long()
          y[0, 0] = 2
          cm.update((y_pred, y))
  
file_path: ignite/tests/ignite/metrics/test_multilabel_confusion_matrix.py
imports: import numpy
  import pytest
  import torch
  from sklearn.metrics import multilabel_confusion_matrix
  import ignite.distributed
  from ignite.exceptions import NotComputableError
  from ignite.metrics.multilabel_confusion_matrix import MultiLabelConfusionMatrix
label_desc: Use image node_id 3 for calling a global function with example usage: test_multiclass_wrong_inputs() without return types