code: def test_invalid(self):
      with pytest.raises(Exception):
          KORNIA_CHECK_IS_GRAY(torch.rand(3, 4, 4))
      with pytest.raises(Exception):
          KORNIA_CHECK_IS_GRAY(torch.rand(1, 4, 4, 4))
      with pytest.raises(Exception):
          KORNIA_CHECK_IS_GRAY(torch.rand(1, 3, 4, 4))
      with pytest.raises(Exception):
          KORNIA_CHECK_IS_GRAY(torch.rand(1, 3, 4, 4, 4))
  
imports: import pytest
  import torch
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_DM_DESC, KORNIA_CHECK_IS_COLOR, KORNIA_CHECK_IS_COLOR_OR_GRAY, KORNIA_CHECK_IS_GRAY, KORNIA_CHECK_IS_LIST_OF_TENSOR, KORNIA_CHECK_IS_TENSOR, KORNIA_CHECK_LAF, KORNIA_CHECK_SAME_DEVICE, KORNIA_CHECK_SAME_DEVICES, KORNIA_CHECK_SAME_SHAPE, KORNIA_CHECK_SHAPE, KORNIA_CHECK_TYPE
label_desc: Use image node_id 2 for calling the TestCheckIsGray obj's underlying member method code with example usage: obj.test_invalid() without return types