code: def test__check_shape():
      acc = Accuracy()
  
      with pytest.raises(
          ValueError, match=r"y and y_pred must have compatible shapes"
      ):
          acc._check_shape(
              (
                  torch.randint(0, 2, size=(10, 1, 5, 12)).long(),
                  torch.randint(0, 2, size=(10, 5, 6)).long(),
              )
          )
  
      with pytest.raises(
          ValueError, match=r"y and y_pred must have compatible shapes"
      ):
          acc._check_shape(
              (
                  torch.randint(0, 2, size=(10, 1, 6)).long(),
                  torch.randint(0, 2, size=(10, 5, 6)).long(),
              )
          )
  
      with pytest.raises(
          ValueError, match=r"y and y_pred must have compatible shapes"
      ):
          acc._check_shape(
              (
                  torch.randint(0, 2, size=(10, 1)).long(),
                  torch.randint(0, 2, size=(10, 5)).long(),
              )
          )
  
imports: import os
  import pytest
  import torch
  from packaging.version import Version
  from sklearn.metrics import accuracy_score
  import ignite.distributed
  from ignite.engine import Engine
  from ignite.exceptions import NotComputableError
  from ignite.metrics import Accuracy
label_desc: Use image node_id 2 for calling a global function with example usage: test__check_shape() without return types